From b33d0ee975caaba25a8314642c8750a42dff2c43 Mon Sep 17 00:00:00 2001 From: Per Jonsson <poj@lysator.liu.se> Date: Sun, 25 Oct 2009 21:00:41 +0000 Subject: [PATCH] Implement the last change correctly. --- backup-one-task | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/backup-one-task b/backup-one-task index 7272061..2b11f6e 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 -- GitLab