diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-12-31 16:37:36 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2012-12-31 16:38:48 +0200 |
commit | 0ddbe02c5fadcef7dfb579ae484b134162c66621 (patch) | |
tree | 4c9ff89cd7ca9b2d04359b944b2151a83553ae22 | |
parent | dfc873ad5f8cd919bdf7f9c911c9075cb3ea45b9 (diff) | |
download | beam-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-x | cleaner.in | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 |