Introduction
LiteSpeed doesn't automatically clear the VirtualHost-level cache. However, this cache can be cleared with a cron job. This article provides the steps to create the cron job.
Procedure
- Access the server's command line as the 'root' user via SSH or "Terminal" in WHM.
- Open
crontabin editor mode.crontab -e
- Press the
okey to enter insert mode on a new line. - Enter the following article.
0 0 * * * LARGE_LSDIR="$(du --threshold=30G -sh /home/*/lscache/ | cut -f2-)"; for ls_path in $LARGE_LSDIR; do echo "Clean up $ls_path"; find $ls_path -type f -mtime +1440 -exec rm -f {} \;; done - Press the
esckey to exit insert mode. - Enter
:wqand hit theenterkey to save the changes and exitcrontab.
Comments
0 comments
Article is closed for comments.