I can reproduce the problem and I can confirm that Mike Gabriel's fix fixes
it.

Before the fix, I get this (and I can reproduce this over and over again,
it's been happening every night for weeks now):

david@silverstone:/mnt$ sudo /usr/local/bin/mount_backup_usb.sh && sudo
rsnapshot -v daily
echo 31032 > /var/run/rsnapshot.pid
/bin/rm -rf /mnt/BACKUP/daily.6/
mv /mnt/BACKUP/daily.5/ /mnt/BACKUP/daily.6/
mv /mnt/BACKUP/daily.4/ /mnt/BACKUP/daily.5/
mv /mnt/BACKUP/daily.3/ /mnt/BACKUP/daily.4/
mv /mnt/BACKUP/daily.2/ /mnt/BACKUP/daily.3/
mv /mnt/BACKUP/daily.1/ /mnt/BACKUP/daily.2/
/bin/cp -al /mnt/BACKUP/daily.0 /mnt/BACKUP/daily.1
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
    --exclude=/home/*/.cache/ --exclude=/home/*/.local/share/Trash/ \
    --exclude=/home/*/.local/share/gvfs-metadata
--exclude=/home/*/.mozilla/ \
    --exclude=/home/*/.cxoffice/**/Recent/ \
    --exclude=/home/*/.cxoffice/**/Temp/ --exclude=/home/*/.xsession-errors
\
    /home /mnt/BACKUP/daily.0/localhost/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
    --exclude=/home/*/.cache/ --exclude=/home/*/.local/share/Trash/ \
    --exclude=/home/*/.local/share/gvfs-metadata
--exclude=/home/*/.mozilla/ \
    --exclude=/home/*/.cxoffice/**/Recent/ \
    --exclude=/home/*/.cxoffice/**/Temp/ --exclude=/home/*/.xsession-errors
\
    /etc /mnt/BACKUP/daily.0/localhost/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
    --exclude=/home/*/.cache/ --exclude=/home/*/.local/share/Trash/ \
    --exclude=/home/*/.local/share/gvfs-metadata
--exclude=/home/*/.mozilla/ \
    --exclude=/home/*/.cxoffice/**/Recent/ \
    --exclude=/home/*/.cxoffice/**/Temp/ --exclude=/home/*/.xsession-errors
\
    /usr/local /mnt/BACKUP/daily.0/localhost/
touch /mnt/BACKUP/daily.0/
/usr/local/bin/rsnapshot_postexec.sh
umount: /mnt/BACKUP: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
rmdir: failed to remove `/mnt/BACKUP': Device or resource busy
WARNING: cmd_postexec "/usr/local/bin/rsnapshot_postexec.sh" returned 1
rm -f /var/run/rsnapshot.pid

after the fix, it works:

david@silverstone:/mnt$ sudo /usr/local/bin/mount_backup_usb.sh && sudo
rsnapshot -v daily
echo 20199 > /var/run/rsnapshot.pid
/bin/rm -rf /mnt/BACKUP/daily.6/
mv /mnt/BACKUP/daily.5/ /mnt/BACKUP/daily.6/
mv /mnt/BACKUP/daily.4/ /mnt/BACKUP/daily.5/
mv /mnt/BACKUP/daily.3/ /mnt/BACKUP/daily.4/
mv /mnt/BACKUP/daily.2/ /mnt/BACKUP/daily.3/
mv /mnt/BACKUP/daily.1/ /mnt/BACKUP/daily.2/
/bin/cp -al /mnt/BACKUP/daily.0 /mnt/BACKUP/daily.1
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
    --exclude=/home/*/.cache/ --exclude=/home/*/.local/share/Trash/ \
    --exclude=/home/*/.local/share/gvfs-metadata
--exclude=/home/*/.mozilla/ \
    --exclude=/home/*/.cxoffice/**/Recent/ \
    --exclude=/home/*/.cxoffice/**/Temp/ --exclude=/home/*/.xsession-errors
\
    /home /mnt/BACKUP/daily.0/localhost/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
    --exclude=/home/*/.cache/ --exclude=/home/*/.local/share/Trash/ \
    --exclude=/home/*/.local/share/gvfs-metadata
--exclude=/home/*/.mozilla/ \
    --exclude=/home/*/.cxoffice/**/Recent/ \
    --exclude=/home/*/.cxoffice/**/Temp/ --exclude=/home/*/.xsession-errors
\
    /etc /mnt/BACKUP/daily.0/localhost/
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded \
    --exclude=/home/*/.cache/ --exclude=/home/*/.local/share/Trash/ \
    --exclude=/home/*/.local/share/gvfs-metadata
--exclude=/home/*/.mozilla/ \
    --exclude=/home/*/.cxoffice/**/Recent/ \
    --exclude=/home/*/.cxoffice/**/Temp/ --exclude=/home/*/.xsession-errors
\
    /usr/local /mnt/BACKUP/daily.0/localhost/
touch /mnt/BACKUP/daily.0/
/usr/local/bin/rsnapshot_postexec.sh
rm -f /var/run/rsnapshot.pid

Now we have two datapoints. I can try talking to upstream? I may even still
have commit rights for rsnapshot (I used to).

David

Reply via email to