Monday
This shell script will clean lighttpd web server cache. You need to run this script via a cron job. Download install script at /etc/cron.daily directory.
#!/bin/bash
# Shell script to clean web server cache stored at /var/www/cache/ directory.
# ————————————————————————-
# This script is licensed under GNU GPL version 2.0 or above
# ————————————————————————-# Cache dir path
CROOT=”/var/www/cachelighttpd/”#Deleting files older than 10 days
DAYS= 10# Lighttpd user and group
LUSER=”lighttpd”
LGROUP=”lighttpd”# 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