aboutsummaryrefslogtreecommitdiff
path: root/cleaner.in
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-01-16 15:18:55 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2013-01-16 15:22:08 +0200
commitb2eed67d1b65ffa65c7164216bd27a222a442a6f (patch)
tree1ae728abf062a63378b4f333067845d23b5e3c64 /cleaner.in
parent0ddbe02c5fadcef7dfb579ae484b134162c66621 (diff)
downloadbeam-b2eed67d1b65ffa65c7164216bd27a222a442a6f.tar.gz
beam-b2eed67d1b65ffa65c7164216bd27a222a442a6f.tar.bz2
Fix threshold calculation in cleaner.in
* cleaner.in: Fix 0ddbe02c. * NEWS: Version 1.4 * configure.ac: Update. * doc/beam-module.5in: Fix formatting.
Diffstat (limited to 'cleaner.in')
-rwxr-xr-xcleaner.in15
1 files changed, 11 insertions, 4 deletions
diff --git a/cleaner.in b/cleaner.in
index 1d14fd4..0413943 100755
--- a/cleaner.in
+++ b/cleaner.in
@@ -56,7 +56,7 @@ thisweek=$(date +%U)
if [ $thisweek -gt $retainweeks ]; then
lastweek=$((thisweek - retainweeks))
else
- lastweek=$((thisweek + 53 - retainweeks))
+ lastweek=$((thisweek + 54 - retainweeks))
fi
$verbose \# removing from $dir files ending in $suffix and older than week $lastweek
@@ -70,8 +70,15 @@ fi |
do
$verbose \# considering $name
week=$(expr "$name" : '[^-][^-]*-\([0-9][0-9]*\)-.*')
- if [ $week -le $lastweek ]; then
- $verbose \# removing $name
- $dry_run rm $dir/$name
+ if [ $thisweek -ge $week ]; then
+ if [ $((thisweek - week)) -gt $retainweeks ]; then
+ $verbose \# removing $name
+ $dry_run rm $dir/$name
+ fi
+ else
+ if [ $((thisweek + 54 - week)) -gt $retainweeks ]; then
+ $verbose \# removing $name
+ $dry_run rm $dir/$name
+ fi
fi
done

Return to:

Send suggestions and report system problems to the System administrator.