From 43ed6426b5856897550afae4d143161f46e5010c Mon Sep 17 00:00:00 2001 From: jonsowman Date: Tue, 3 Aug 2010 07:51:28 +0000 Subject: [PATCH] More verbose cronjob output for debug --- cron/prune-predictions-cronjob.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cron/prune-predictions-cronjob.sh b/cron/prune-predictions-cronjob.sh index bb42f8b..9b39f6d 100755 --- a/cron/prune-predictions-cronjob.sh +++ b/cron/prune-predictions-cronjob.sh @@ -1,4 +1,14 @@ #!/bin/bash -find /var/www/hab/predict/predict/preds/* -type d -mtime +7 -exec rm -rf {} \; + +PARAM="mtime" +AGE="7" + +REPOROOT="/var/www/hab/predict/" +DATADIR="predict/preds" + +echo `ls $REPOROOT$DATADIR/ -l | wc -l` "prediction scenarios found" +echo `find $REPOROOT$DATADIR/* -maxdepth 0 -$PARAM +$AGE | wc -l` "of them had $PARAM of more than $AGE days" +echo "Now deleting..." +find $REPOROOT$DATADIR/* -maxdepth 0 -$PARAM +$AGE -exec rm -rf {} \; echo "DONE"