Closed kbm15 closed 7 years ago
@alexrj We ran out of space on dl.slic3r.org
@alexrj For purposes of cron:
for i in $(ls -trl /path/to/folder/*.zip | awk '{print $9}' | head -n$(expr $(ls /path/to/folder/*.zip | wc -l) - 10)); do
rm /path/to/folder/$i
done
will delete all but the 10 newest files ending in zip in /path/to/folder
Wrapping that in a script:
#!/bin/bash
FOLDER=$1
PATTERN=$2
COUNT=$3
for i in $(ls -trl $FOLDER/$PATTERN | awk '{print $9}' | head -n$(expr $(ls $FOLDER/$PATTERN | wc -l) - $COUNT));
do
rm -f $i;
done
Usage: rmoldest.sh FOLDER 'PATTERN' COUNT
Get cron to run that (probably weekly), and wrap the pattern in single quotes when you call it (so .zip -> '.zip')
For now I'd have cron execute it daily on each of the dev/ paths. and monthly on dev/*/branches
All new files are empty in http://dl.slic3r.org/dev/win/