Skip to content

Instantly share code, notes, and snippets.

@leommoore
Created May 23, 2016 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leommoore/a2c8ca27875de8b16d8d336a6fce2528 to your computer and use it in GitHub Desktop.
Save leommoore/a2c8ca27875de8b16d8d336a6fce2528 to your computer and use it in GitHub Desktop.
rsync

##rsync

If your folder contains subfolders and more importantly symlinks you want to use rsync:

rsync -aruv localfolder/ user@server:destination/

Or in reverse:

rsync -aruv user@server:destination/ localfolder/

This will do a recursive backup / copy from localfolder to your server while keeping ownership and permissions intact. The solutions suggested so far are valid however scp doesn't handle symlinks by default and will instead create a new copy of the linked file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment