jborg / attic

Deduplicating backup program
Other
1.11k stars 104 forks source link

Error backing up a changing filesystem #143

Open joachimmueller opened 9 years ago

joachimmueller commented 9 years ago

I back up my files like this:

attic create --stats $REPOSITORY::`hostname`-`date +%Y-%m-%dT%H-%M-%S` $BACKUP_DIRS $BACKUP_EXCLUDES >> $LOGFILE 2>&1 || {
    echo "Error executing attic create." >> $LOGFILE
    mail_report
    exit 1
}

Today I 've got the following error:

attic: <PATH>/temp/maven2-tmp2062034583962716927.dir/_d.fdx: [Errno 2] No such file or directory: '<PATH>/temp/maven2-tmp2062034583962716927.dir/_d.fdx'
...
attic: Exiting with failure status due to previous errors
Error executing attic create.

I presume the filesystem has changed between backup processing phases. Of course I can exclude <PATH>/temp but maybe the exception handling should be changed so that in this case the errors are logged as warnings but do not result in terminating attic with an error.

Ernest0x commented 9 years ago

In that case, Attic is not terminating abnormally but with warnings. These warnings may be important or not so important (as in your case). What could be improved here is to have different exit codes for termination with warnings and abnormal termination, so that you can create three statuses for notifications:

anarcat commented 9 years ago

@jborg wouldn't it be a good idea to automatically (detect support for and) create filesystem snapshots before doing backups? i've had good experience with those writing bup-cron, since bup also freaks out if files change or disappear before its index and save stages.

i basically had to write bup-cron partially for that reason, but would that be a welcome addition to attic, or would that be yet another third party addition?