Copying Local to Remote

Need to transfer a directory with a lot of small files to a remote server? I found that taring the contents locally, then untaring them on the remote server can drastically increase the upload speed (in my case it was by a factor of 4 compared to using scp). Here’s a nice one line bash command you can use:

tar cz local_directory | pv | ssh user@remote_server ‘cat | tar xz -C /path/to/remote/directory/’

You can take out the pv function if you want; it’s just there to track upload progress.



A daily programming newsletter ( Twitter:

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store