Ok so I started out using rsync with the options ‘-a –progress –delete’ and I thought that was doin’ the job just fine. But recently I migrated our old 600mhz Dell Optiplex GX110 to a Sans Digital MobileNAS MN2L dual drive RAID NAS and the rsyncs weren’t going as planned.
The rsync argument ‘-a’ preserves permissons, owner, groups, etc. (-a for archive) but I would run it repeatedly to get the latest changes and it would start copying the whole thing over again. After visiting the rsync man page I came up with a new set of arguments that seem to be working out great.
UPDATE: After much confusion I have come to the conclusion that when using rsync via cygwin over SMB shares for large file transfers, modification times are often slightly off, causing many files to be overwritten repeatedly. After trying a few options, I found that the argument
--modify-window=10can rectify this issue.
[sourcecode language=’bash’]rsync -rtmvh –modify-window=10 –stats –progress /path/to/source /path/to/destination/[/sourcecode]
-r, –recursive recurse into directories
-t, –times preserve modification times
-m, –prune-empty-dirs prune empty directory chains from file-list
-v, –verbose increase verbosity
-h, –human-readable output numbers in a human-readable format
–modify-window=10 treat timestamps as equal if they differ by no more than 10 seconds
–stats give some file-transfer stats
–progress show progress during transfer
*Great for testing: -n, –dry-run perform a trial run with no changes made, just would-be transfer results
*Optional: –delete delete extraneous files from dest dir
For many more useful arguments visit the official rsync man page.
I wanted to log this before my .bash_history gets messed up again. 🙂