Commit 79fd109a authored by Holger Levsen's avatar Holger Levsen
Browse files

rdn: also cleanup empty files from cache

parent 5495a4c8
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -11,6 +11,10 @@ if [ ! -d $CACHE ] ; then
	exit 0
fi

# delete empty files from cache first
find $CACHE -type f -size 0 -exec rm {} \;

# delete old files from cache if cache size is too big
LIMIT=100
case $HOSTNAME in
	codethink*)		LIMIT=200  ;;
@@ -20,9 +24,7 @@ case $HOSTNAME in
	riscv64*)		LIMIT=180 ;;
	*)			;;
esac

SIZE=$(du -sh $CACHE | grep G | cut -d 'G' -f 1||echo 0)

if [ $SIZE -gt $LIMIT ] ; then
	echo "$CACHE is still ${SIZE}G, reducing further."
	# delete 1000 files which have old access times