Package: duplicity
Version: 0.7.03-1
Severity: normal

--- Please enter the report below this line. ---

I noticed that duplicity isn't performing the daily backups that I scheduled 
from a cron job [1], instead it fails like this every day:

/etc/cron.daily/backup:

Local and Remote metadata are synchronized, no sync needed.
Last full backup date: Mon Jun  8 09:18:54 2015
No extraneous files found, nothing deleted in cleanup.
Another instance is already running with this archive directory
If you are sure that this is the  only instance running you may delete
the following lockfile and run the command again :
        /var/cache/duplicity/96c9f57d3b62aef19b25e2cc03d2f0ab/lockfile.lock
run-parts: /etc/cron.daily/backup exited with return code 23

--- ---

Looks like duplicity can't deal with stale lock files that are left around
when rebooting while duplicity is still running.

Would you consider using POSIX advisory locks (fcntl F_SETLK) instead?
The locks are automatically released when the process exits or crashes, and you 
can even determine
which process is currently holding the lock (fcntl F_GETLK). 
There are some limitations if you open the file multiple times or use multiple 
threads [2],
but should be more reliable than relying just on the presence of a file.

[1] /etc/cron.daily/backup calls duplicity like this:
--- ---
for DIR in $BDIRS
do

  if [ "$DIR" = '.' ]; then
        TARGETDIR=system
        EXCLUDE="--exclude-filelist /root/duplicity-exclude.conf"
  else
        TARGETDIR="$DIR"
        EXCLUDE="--exclude-filelist /root/duplicity-exclude-$DIR.conf"
  fi

  export PASSPHRASE=
  export SIGN_PASSPHRASE=
  LOGFILE="$LOGDIR/`basename $TARGETDIR`.log"
  duplicity --volsize $VOLSIZE --archive-dir $ARCHIVEDIR remove-all-but-n-full 
2 --force -v3 "$TARGET/$TARGETDIR/" >>$LOGFILE
  duplicity cleanup --archive-dir $ARCHIVEDIR --force $TARGET/$TARGETDIR/

  duplicity --exclude-other-filesystems --full-if-older-than 1M --volsize 
$VOLSIZE --archive-dir $ARCHIVEDIR -v5 --encrypt-key $ENCRYPTKEY --sign-key 
$SIGNKEY $EXCLUDE /$DIR $TARGET/$TARGETDIR/ >>$LOGFILE 

done

[2] https://www.sqlite.org/howtocorrupt.html 'Posix advisory locks canceled by 
a separate thread doing close()'

--- System information. ---
Architecture: amd64
Kernel:       Linux 4.1.0-0.bpo.2-amd64

Debian Release: 8.2
  900 stable          security.debian.org 
  900 stable          httpredir.debian.org 
  900 jessie-backports httpredir.debian.org 
  500 unstable        httpredir.debian.org 
  500 testing         vol-repo.s3.indian.skylable.com 
  500 testing         httpredir.debian.org 
  500 stable-updates  httpredir.debian.org 
    1 experimental    httpredir.debian.org 

--- Package information. ---
Package's Depends field is empty.

Package's Recommends field is empty.

Package's Suggests field is empty.

Reply via email to