Shell script para eliminar el cache de un web server. Este escript puede ser usado en un cron o directamente en el cron.daily
#!/bin/bash
# Shell script para eliminar el cache de un web server cache almacenado en el directorio /var/www/cache/·
#
#
#
# Cache dir path
CROOT=”/var/www/webcache/”
#Deleting files older than 10 days
DAYS=10
# Lighttpd user and group
LUSER=”apache”
LGROUP=”apache”
# start cleaning
find ${CROOT} -type f -mtime +${DAYS} | xargs -r /bin/rm
# if directory missing just recreate it
if [ ! -d $CROOT ]
then
mkdir -p $CROOT
chown ${LUSER}:${LGROUP} ${CROOT}
fi