I'm running a daily cronjob
, using rsync
to copy files from a Drobo FS, which is mounted locally via autofs
on demand as a CIFS share. Why do I get these warnings about the file existing and a rename? Could a file be in use at the time of backup? Are there any other rsync
options I can include?
/usr/bin/nice -n +20 /usr/bin/rsync --update -raz --progress --no-specials
--no-devices --fuzzy --delay-updates --delete-delay --exclude cache/
--exclude=.cache --exclude /local/dsm/sbin/exclude.txt /mnt/Public/myuser/
myuser@mydomain:/mnt/myfolder
RESULT CODE: 12
ERROR OUTPUT:
rsync: rename "/mnt/myfolder/myuser/Book Analysis
Project/loading_utils/.data_loader.py.MPk9YW" -> "myuser/Book Analysis
Project/loading_utils/.~tmp~/data_loader.py": File exists (17)
Edit: the --fuzzy
option came from this other SE thread.
I was able to get the errors to disappear. This user mentions using the
-b
option with the --backup-dir=DIR
, so all files that are different will go intoDIR
. I have not been using the-b
option but I noticed what currently happens. The original file is placed in a newly created directory, in this case.~tmp~
: ls -al myuser/Book\ Analysis\ Project/scripts/.~tmp~/ total 37 drwx------ 2 myuser domain users 1400 Jul 14 07:28 . drwxrwxrwx 5 myuser domain users 3640 Jul 8 12:09 .. -rwxrwxrwx 1 myuser domain users 14385 Jul 5 14:42 book_data_extractor.py -rwxrwxrwx 1 myuser domain users 6038 Jul 5 14:42 cfg_extractor.py -rwxrwxrwx 1 myuser domain users 10963 Jul 8 19:44 run_book_data_extractor.pyI found another suggestion here, which is to use
--delete-excluded
, which as this user points out:Once the rsync ran and deleted all of the
.~tmp~
files/directories, the errors ceased.However the
-b
option appears to create another sub-folder if the file changes multiple times. Outside of changing torsnapshot
I take it this is the correct action? It ends up looking like this:The full option looks like this:
--backup-dir=/path/to/original-file