Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Edit the path below for your installation
- WP_PATH=/srv/www/cnx-software.com/public_html
- LOG_FILE=/tmp/qcache.log
- if [ -z $WP_PATH ]; then
- echo "WP_PATH not set, please edit the script to define WP_PATH" >> $LOG_FILE
- exit 0
- fi
- nobody_files=`grep -L body $WP_PATH/wp-content/cache/zencache/* -R | grep www-cnx`
- num_files=$((`echo "$nobody_files" | wc -l` - 1))
- if [ $num_files = 0 ]
- then
- echo "No cached file without <body> tag could be found" >> $LOG_FILE
- else
- datedel=`date`
- echo "$datedel: Deleting $num_files cache files without <body> tag" >> $LOG_FILE
- rm $nobody_files
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement