cusf-standalone-predictor/cron/prune-predictions-cronjob.sh

15 wiersze
462 B
Bash
Czysty Zwykły widok Historia

#!/bin/bash
2010-08-03 07:51:28 +00:00
PARAM="mtime"
2012-07-12 17:05:27 +00:00
AGE="14"
2010-08-03 07:51:28 +00:00
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 {} \;
2010-08-03 08:30:52 +00:00
echo "Done deleting."
echo `ls $REPOROOT$DATADIR/ -l | wc -l` "prediction scenarios remaining"