5 ms·
tar czf - . | ssh destination "tar xz" To pipe all the contents of your current directory (including dotfiles) to the destination machine. Greetings from LSI-
by appplemac 14y ago
tar czf - . | ssh destination "tar xz"
To pipe all the contents of your current directory (including dotfiles) to the destination machine.
Greetings from LSI-UPC!
- carlesfe 14y agoI use that everyday, but didn't think about adding it to the list. It's on now, thanks! PS: hey, we're neighbors! :)
- deafbybeheading 14y agoWhy not rsync?
- inyourtenement 14y agoThey're both useful. tar over ssh is very fast for large amounts of data. rsync is only fast if most of the data already exists.
- cowmix 14y agoI would change this to: tar czf - . | ssh destination "cd /remote/dir; tar xz"
- appplemac 14y agoThere is also tar -C /local/dir -czf - . | ssh dest "tar -C /remote/dir -xz"
- zengargoyle 14y agoYou will one day punch yourself for not being safe. tar czf - | ssh destination 'cd /remote/dir && tar xzf -' Test that `cd` or one day you'll end up extracting in the wrong place.
- kbenson 14y agoI used to use this, because it's awesome that it got all the file types correct (sockets, for example). Then I learned to love rsync -av. The benefits are many-fold.