As people say, deleting files is the way to go. Expanding in previous answers, I made this script that deletes any file that exceeded its maximum storage age. Perform it regularly as a cronjob .
#!/bin/bash d=$1 now=$(date +%s) MINRET=86400 if [ -z "$d" ]; then echo "Must specify a directory to clean" exit 1 fi find $d -name '*.wsp' | while read w; do age=$((now - $(stat -c '%Y' "$w"))) if [ $age -gt $MINRET ]; then retention=$(whisper-info.py $w maxRetention) if [ $age -gt $retention ]; then echo "Removing $w ($age > $retention)" rm $w fi fi done find $d -empty -type d -delete
A few bits to be aware of - calling whisper-info pretty tough. To reduce the number of calls to it, I set the MINRET constant, so that no file will be considered for deletion until it becomes 1-day (24 * 60 * 60 seconds) - adjust it according to your needs. Perhaps there are other things that can be done to scald the work or even increase its effectiveness, but I still did not need to do this.
IBam Mar 15 '16 at 15:01 2016-03-15 15:01
source share