diff --git a/backup-one-task b/backup-one-task index 7272061e1e8e1da9aaf2b50b68fdf25724caaa25..2b11f6e18eec9340e1c74a497df04116fbd7bf67 100755 --- a/backup-one-task +++ b/backup-one-task @@ -18,6 +18,7 @@ retry=0 new=0 only_prune=0 only_clone=0 +first_run=0 ss=/opt/LYSrdiff/bin/lysrdiff-set-status.py @@ -80,6 +81,10 @@ origin="$base"/origin rdiffdir="$files/rdiff-backup-data" incrementsdir="$rdiffdir/increments" +if [ ! -d "$files" ] +then + first_run=1 +fi mkdir -p "$files" mkdir "$lockdir" || exit 1 @@ -139,7 +144,7 @@ then AGE=`cat "$age"` fi - if [ -d "$files" ] + if [ $first_run = 1 ] then echo -ne "${CLR}${msg}: removing increments older than $AGE" $ss --status $disk $part "${msg}: removing increments older than $AGE" @@ -150,6 +155,8 @@ then --force \ -v 2 \ "$files" > "$rdiffcleanlogfile" 2>&1 + else + touch "$rdiffcleanlogfile" fi fi