0

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.

RobbieTheK
  • 390
  • 5
  • 15

1 Answers1

0

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 into DIR. 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.py

I found another suggestion here, which is to use --delete-excluded, which as this user points out:

If you have excluded files or directories from being transferred, --delete-excluded will remove them from the destination side (this does not have to be the "remote server", you can use rsync to copy from a server to the local computer) if it finds them there. For instance, if you use --exclude=*.o --delete-excluded, then if rsync finds any files ending in .o on the destination side, it will remove them whether they exist in the source directory or not.

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 to rsnapshot I take it this is the correct action? It ends up looking like this:

/myuser/original-file/original-file/original-file/original-file/original-file

The full option looks like this: --backup-dir=/path/to/original-file

RobbieTheK
  • 390
  • 5
  • 15