|
|
@ -1,12 +1,14 @@ |
|
|
|
#!/bin/bash |
|
|
|
#!/bin/bash |
|
|
|
HACKDIR=$1 |
|
|
|
HACKDIR=$1 |
|
|
|
USERDIR=$2 |
|
|
|
USERDIR=$2 |
|
|
|
|
|
|
|
TTYRECCACHE=$3 |
|
|
|
|
|
|
|
SOTWDUMPCACHE=$4 |
|
|
|
|
|
|
|
|
|
|
|
### |
|
|
|
### |
|
|
|
# clean old ttyrecs |
|
|
|
# clean old ttyrecs |
|
|
|
### |
|
|
|
### |
|
|
|
cd /$HACKDIR/user/$USERDIR/ttyrec/ |
|
|
|
cd /$HACKDIR/user/$USERDIR/ttyrec/ |
|
|
|
ls -1tr | head -n -10 | xargs -d '\n' rm -f -- |
|
|
|
ls -1tr | head -n -$TTYRECCACHE | xargs -d '\n' rm -f -- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### |
|
|
|
### |
|
|
@ -16,8 +18,9 @@ cd /$HACKDIR/user/$USERDIR/sotw/ |
|
|
|
|
|
|
|
|
|
|
|
# there are always 4 symlinked files |
|
|
|
# there are always 4 symlinked files |
|
|
|
# leave 5 of the latest dumps |
|
|
|
# leave 5 of the latest dumps |
|
|
|
|
|
|
|
DUMPFILES=$(expr $SOTWDUMPCACHE + 4) |
|
|
|
|
|
|
|
|
|
|
|
FILES=$(ls -1tr *.txt | head -n -9) |
|
|
|
FILES=$(ls -1tr *.txt | head -n -$DUMPFILES) |
|
|
|
|
|
|
|
|
|
|
|
for f in $FILES; do |
|
|
|
for f in $FILES; do |
|
|
|
#test -h $f || echo "removing old file $f" |
|
|
|
#test -h $f || echo "removing old file $f" |
|
|
|