aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-12-31 16:37:36 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2012-12-31 16:38:48 +0200
commit0ddbe02c5fadcef7dfb579ae484b134162c66621 (patch)
tree4c9ff89cd7ca9b2d04359b944b2151a83553ae22
parentdfc873ad5f8cd919bdf7f9c911c9075cb3ea45b9 (diff)
downloadbeam-0ddbe02c5fadcef7dfb579ae484b134162c66621.tar.gz
beam-0ddbe02c5fadcef7dfb579ae484b134162c66621.tar.bz2
Fix threshold calculation in cleaner.in
* cleaner.in: Fixup lastweek if it becomes negative. This happens at the beginning of the year.
-rwxr-xr-xcleaner.in8
1 files changed, 6 insertions, 2 deletions
diff --git a/cleaner.in b/cleaner.in
index 925ec3f..1d14fd4 100755
--- a/cleaner.in
+++ b/cleaner.in
@@ -53,8 +53,12 @@ case $# in
esac
thisweek=$(date +%U)
-lastweek=$((thisweek - retainweeks))
-
+if [ $thisweek -gt $retainweeks ]; then
+ lastweek=$((thisweek - retainweeks))
+else
+ lastweek=$((thisweek + 53 - retainweeks))
+fi
+
$verbose \# removing from $dir files ending in $suffix and older than week $lastweek
if [ -z "$suffix" ]; then

Return to:

Send suggestions and report system problems to the System administrator.