I am working on an rsync
script for directory replication. I have it syncing only new and modified files or directories but I don't like the fact that it's copying renamed files or directories as a new file or directory, keeping the files not in sync. I have also set a bandwidth limit of 1MB since this will run during business work hours.
Here's my script:
rsync -zvru --bwlimit=1024 /mymounts/test1/ /mymounts/test2
How can I keep the files and directories in sync if someone renames something and still only copy new or modified files?
Here are the files in question:
ls "/mymounts/test1/some stuff"
new directory newfile1.txt newfile3.txt renamedFile.txt
ls "/mymounts/test2/some stuff"
new directory newfile1.txt newfile2.txt newfile3.txt renamedFile.txt
Or would there be a way to even move the renamed files to another directory say: /mymounts/VerControl
?