Thursday, 26 January 2017

Linux rsync comand usage examples

rsync
-a
--progress
--delete = delete files/folders from /destination that are not on /source (so /destination is an exact mirror of /source)
--exclude
--dry-run
Always start with -n (fake run) before doing a real run.
-r = recursive (copy all directories, contents and their subdirectories)
-v = be verbose


1. Sync dirs
rsync -av --delete src/  dest/

2. With SSH
rsync -av –delete -e ssh /Directory1/ geek@192.168.235.137:/
Directory2/

3. With SSH and port
rsync -av –delete -e 'ssh -p 12345' /Directory1/ geek@192.168.235.137:/Directory2/

No comments:

Post a Comment