|
|
@@ -38,19 +38,22 @@ then
|
|
|
then
|
|
|
if rm -f $FILE
|
|
|
then
|
|
|
- echo "Deleted $FILE"
|
|
|
+ now=$(date)
|
|
|
+ echo "${now}: Deleted $FILE" >> /var/log/ftpDeleter.log
|
|
|
|
|
|
CAPACITY=$(df -k . | awk '{gsub("%",""); capacity=$5}; END {print capacity}')
|
|
|
|
|
|
if [ $CAPACITY -le $CAPACITY_LIMIT ]
|
|
|
then
|
|
|
# we're below the limit, so stop deleting
|
|
|
- echo "Below limit, stopped deleting."
|
|
|
+ now=$(date)
|
|
|
+ echo "${now}: Below limit, stopped deleting. Capacity: ${CAPACITY}" >> /var/log/ftpDeleter.log
|
|
|
exit
|
|
|
fi
|
|
|
fi
|
|
|
fi
|
|
|
done
|
|
|
else
|
|
|
- echo "Don't need to delete anything, capacity: ${CAPACITY}"
|
|
|
+ now=$(date)
|
|
|
+ echo "${now}: Don't need to delete anything, capacity: ${CAPACITY}"
|
|
|
fi
|