3 ms·
From a very old notes file I have ... tar cf - /mnt/data2 | ssh user@10.0.0.10 "cat > /mnt/data1/file1/file_data2.tar" ... and if the directory is large,
by rsync 7y ago
From a very old notes file I have ...
tar cf - /mnt/data2 | ssh user@10.0.0.10 "cat > /mnt/data1/file1/file_data2.tar"
... and if the directory is large, you can 'split' it into multiple files:
tar cfp - /mnt/data1 | ssh user@10.0.0.10 "split - -b 1024m /mnt/data1/file1/file_data2.tar"
This is really no longer relevant because, of course, we all just use rsync ... but in the modern world, my favorite example of the unix philosophy is:
mysqldump -u mysql db | ssh user@rsync.net "dd of=db_dump"
- jandrese 7y agoNone of those are quite right IMHO: tar -czvf - <sourcedir> | ssh <user>@<remotehost> tar -xzf - -C <remotedir> This is _much_ faster if you're sending over a directory with a lot of small files, especially if the link has even a modest amount of latency. The 'z' parameter can be omitted if the source files are not compressible (media files or already compressed). If the files are highly compressible but very large you might consider this instead: tar -cvf - <sourcedir> | pbzip2 -c | ssh <user>@<remotehost> tar -xf - -C <remotedir>