aboutsummaryrefslogtreecommitdiff
path: root/cleaner.in
diff options
context:
space:
mode:
Diffstat (limited to 'cleaner.in')
-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.