Skip to content

Instantly share code, notes, and snippets.

@smhr
Last active September 10, 2022 04:18
Show Gist options
  • Save smhr/9f85899935b43831bb75489fa491aa2b to your computer and use it in GitHub Desktop.
Save smhr/9f85899935b43831bb75489fa491aa2b to your computer and use it in GitHub Desktop.
rsync examples
## sync a remote directory on a server S1 to a local directory L2 (i.e. copy S1 into L2)
rsync -avh user@192.168.0.1:/S1 /L2
## sync files from a remote directory on a server S1 to a local directory L2 (i.e. copy S1 contents into local L2)
rsync -avh user@192.168.0.1:/S1/ /L2
## sync a local directory L1 to a remote directory /S2 (i.e. copy L1 into remote S2)
rsync -avh ./L1 user@192.168.0.1:/S2
## sync files from a local directory L1 to a remote directory /S2 (i.e. copy L1 and its contents into remote S2)
rsync -avh ./L1/ user@192.168.0.1:/S2
## sync two local folders from L1 to L2 (i.e. copy L1 into L2)
rsync -avh /L1 /L2
## sync two local folders from L1 to L2 (i.e. copy L1 contents into L2)
rsync -avh /L1/ /L2
@smhr
Copy link
Author

smhr commented Oct 10, 2020

Update gist

@smhr
Copy link
Author

smhr commented Oct 25, 2020

Sync paper folder

@smhr
Copy link
Author

smhr commented Jun 22, 2021

Update paper folder to sync

@smhr
Copy link
Author

smhr commented Sep 10, 2022

Remove -z option (it reduces the transfer speed).

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