Comment 5 for bug 409005

Revision history for this message
Julian Gilbey (jdg) wrote :

Hello Germar,

I'm confused by the email notification I just received: what does "milestone none" mean?

I just got bitten by this bug again: for some reason, the backintime backup directory had ended up with wrong permissions (555 or 550, I don't remember exactly - no idea how it happened: nothing that I'm aware of having done), so every backup silently failed for about 3 weeks until I happened to check.

I've now written the following crude user-callback script to work around the problem; there is surely a better solution to this problem!

   Julian

#! /bin/bash

if [ -z "$USER" ]; then USER=root; fi

if [ $3 = 4 ] # error
then
    message="Backintime died with the following error information:
Profile id = $1
Profile name = $2
Error code = $4
Error message = $5

Just letting you know..."

    echo $message | mail -s "BACKINTIME FAILED" $USER
fi

if [ $3 = 2 ] # "Backup process ends" - this may work!
then
    dircount=$(ls -d /media/JG-BACKUP/${USER}/backintime/erdos/${USER}/1/`date ' +%Y%m%d'`* 2>/dev/null | wc -l)
    if [ $dircount -eq 0 ]
    then
        message="WARNING: Backintime finished, but no directory appears to have been created:
Profile id = $1
Profile name = $2

Just letting you know..."

        echo $message | mail -s "BACKINTIME PROBABLY FAILED" $USER
    else
        dirs=$(ls -d -1 /media/JG-BACKUP/${USER}/backintime/erdos/${USER}/1/`date '+%Y%m%d'`* 2>/dev/null)
        message="Backintime finished, and a directory appears to have been created:
Profile id = $1
Profile name = $2
Directory = $dirs

Just letting you know..."

        echo $message | mail -s "BACKINTIME finished" $USER
    fi
fi

exit 0