|
Home | Switchboard | Unix Administration | Red Hat | TCP/IP Networks | Neoliberalism | Toxic Managers |
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and bastardization of classic Unix |
$ rsync -rvnc --delete website/ laptop:projects/website/ deleting schedule.shtml style.css
ATTENTION: The -c option is used because we're paranoid: it forces rsync to compute and compare checksums for each file to verify that they are the same. Otherwise, rsync assumes that files are the same if they have the same timestamp and size (sometimes this gives false positives if timestamps were not preserved when you made the copy). If that is acceptable, you can omit -c to get a speedup.
Compare two folders(recursively) for file names and file contents
Dry run with the update switch (-u) meaning it will only overwrite changed files.
rsync -ruptvn src/ dst/ > /tmp/outputThen you can edit the output file and delete the "speedup" output from the top and bottom so you just have the files to work with. Then you can run a diff...
sourcedir=src;destdir=dst;cat /tmp/output | while read file;do diff -rupN $sourcedir/$file $destdir/$file;done >> /tmp/differences;unset sourcedir destdirLook at the /tmp/differences file to see the changes from diff.