Wednesday, February 6, 2013

Remote compare directories, diff for Linux: rsync --dry-run

Plenty of examples here:

http://www.thegeekstuff.com/2010/09/rsync-command-examples/

Priceless is the option dry-run:

rsync -v --dry-run /home/soa/obelix/scripts/ /tmp/DELETEME



ls /tmp/TEST01/
pippo2.txt pippo.txt


ls /tmp/TEST02/
pippo2.txt


rsync -avz --dry-run --progress --delete /tmp/TEST02/ /tmp/TEST01/
sending incremental file list
./
deleting pippo.txt
pippo2.txt


rsync -avz --dry-run --progress --delete /tmp/TEST01/ /tmp/TEST02/
sending incremental file list
./
pippo.txt
pippo2.txt


So rsync can be used to detect extra files in one directory by using the --delete option, but you should run it twice.

I find rsync very hard to use and it doesn't really behave as I expect it. Forget it.

Let me look into how to use Beyond Compare with remote Linux directories.

Beyond Compare supports SFTP.


No comments: