rsync: one unreadable file causes backup job to fail completely
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Back In Time |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Here's a backintime run (with the excludes list edited out for clarity):
erdos:~ $ backintime --backup-job
WARNING: import keyring failed
Back In Time
Version: 1.0.34
Back In Time comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `backintime --license' for details.
INFO: Lock
INFO: [GnomePlugin.
INFO: [UserCallbackPl
INFO: [GnomePlugin.
INFO: on process begins
INFO: Profile_id: 1
INFO: Compare with old snapshot: 20131129-030001-262
INFO: Command "rsync -rtDH --links --no-p --no-g --no-o --delete --delete-excluded -i --dry-run --out-format=
INFO: Create hard-links
INFO: Command "find "/media/
INFO: Command "cp -aRl "/media/
INFO: Command "find "/media/
INFO: Command "chmod -R a+w "/media/
INFO: Call rsync to take the snapshot
WARNING: Command "rsync -rtDH --links --no-p --no-g --no-o --delete --delete-excluded -v --chmod=Du+wx --exclude=[...] --include=
INFO: Command "find "/media/
INFO: Command "rm -rf "/media/
INFO: Command "chmod -R a-w "/media/
INFO: Command "rm -rf "/media/
ERROR: Failed to take snapshot !!!
INFO: [UserCallbackPl
INFO: [GnomePlugin.
INFO: Unlock
So the effect is that no backup is produced.
Running the listed commands manually revealed the source of the problem:
erdos:~ $ rsync -rtDH --links --no-p --no-g --no-o --delete --delete-excluded -v --chmod=Du+wx --exclude=[...] --include=
sending incremental file list
[...]
home/jdg/.encdir/
rsync: send_files failed to open "/home/
[...]
sent 60,328,711 bytes received 17,619 bytes 375,989.60 bytes/sec
total size is 174,071,292,851 speedup is 2,884.54
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1183) [sender=3.1.0]
erdos:~ $ echo $?
23
So one single file which was unreadable (it turns out that it was - bizarrely - owned by root with permissions 600) caused the entire backup to fail. (Also, the message that the rsync return code was 5888 - which is 23 * 256 = 0x1700 - is not as helpful as saying that the return code is 23.)
I suggest that in the presence of an rsync error code of 23 (and maybe some others as well), a message is given but the backup process is continued nonetheless; nothing else was backed up in this situation, instead of all but one file.
Julian
Oh, one other thing about this bug: in spite of the backup failing, backintime still returned with a final exit status of 0, meaning that the failure couldn't be detected without reading the output produced.