Last active
February 23, 2023 09:30
-
-
Save rponte/d770d1104903d0a32cfc to your computer and use it in GitHub Desktop.
Copying all files from a directory to another using rsync (only difference)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # don't forget the slash (/) at end of dir | |
| rsync -av original-uploads/ uploads/ | |
| # the best way to keep target-dir synchronized with source-dir (even deleted files are synchronized) | |
| rsync -auvz --delete original-uploads/ uploads/ | |
| # synchronizing local-dir into remote-dir (in the end we'll have a dir on remote machine as this: ~/my-files/original-uploads) | |
| # warning: pay attention to the lack of slash in original-dir | |
| rsync -auvz --delete original-uploads rponte@triadworks.com.br:~/my-files |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More info,
https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories-on-a-vps