You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
425 B
28 lines
425 B
5 years ago
|
#!/bin/bash
|
||
|
HACKDIR=$1
|
||
|
USERDIR=$2
|
||
|
|
||
|
###
|
||
|
# clean old ttyrecs
|
||
|
###
|
||
|
cd /$HACKDIR/user/$USERDIR/ttyrec/
|
||
|
ls -1tr | head -n -10 | xargs -d '\n' rm -f --
|
||
|
|
||
|
|
||
|
###
|
||
|
# clean sotw files
|
||
|
###
|
||
|
cd /$HACKDIR/user/$USERDIR/sotw/
|
||
|
|
||
|
# there are always 4 symlinked files
|
||
|
# leave 5 of the latest dumps
|
||
|
|
||
|
FILES=$(ls -1tr *.txt | head -n -9)
|
||
|
|
||
|
for f in $FILES; do
|
||
|
#test -h $f || echo "removing old file $f"
|
||
|
if [ ! -h $f ]; then
|
||
|
rm -rf $f
|
||
|
fi
|
||
|
done
|