rsync - how can I delete files at the destination that are deleted at the source?

I'm using rsync to copy a load of files to a new server. Before actually migrating, I want to run rsync one last time, to make sure I have all the files and the latest versions. However, if a file got deleted on the source, after the previous rsync run, it won't get deleted on the destination, when running one last rsync.

Code:
* rsync syncs files A, B and C
* user modifies B, deletes C and adds D
* rsync will sync files B and D, but does not delete C at the destination

Does rsync have an option to fix this? If so, how?
 
Code:
# here # rsync -vaH --delete-delay . /there
[Note the dot denoting the "here" directory].
If you encounter any incompletion of the command as you run it, you may wish to use the above delete parameter which may fix it...
 
Back
Top