aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-07-04 13:42:15 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2012-07-04 13:42:15 +0300
commitdd89ed279f6948fab60319262ffc4d25da8ecd10 (patch)
tree8b37d8a6815742fd5ec6a0a7174cfde4e889ff8f
parentccb9742c80519ef29d2a529397011dd718613005 (diff)
downloadbeam-dd89ed279f6948fab60319262ffc4d25da8ecd10.tar.gz
beam-dd89ed279f6948fab60319262ffc4d25da8ecd10.tar.bz2
Minor improvement.
* lib/beam/fs.sh: Fall back to level 0 if the previous snapshot file does not exist. This allows to add new items in the middle of the week.
-rwxr-xr-xlib/beam/fs.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/beam/fs.sh b/lib/beam/fs.sh
index 28f4855..6c09e61 100755
--- a/lib/beam/fs.sh
+++ b/lib/beam/fs.sh
@@ -37,8 +37,9 @@ initdb() {
if [ -r $filename ]; then
cp $filename $backup_snapshot_dir/$1-$week-$round-$level.db
else
- abend 1 "previous snapshot file $filename not found; cannot backup at level $level"
- exit 1
+ filename=$backup_snapshot_dir/$1-$week-$round-$level.db
+ test -r $filename && rm $filename
+ logit "previous snapshot file $filename not found; falling back to level 0"
fi
fi
}

Return to:

Send suggestions and report system problems to the System administrator.