Advertisement
cnxsoft

Zencache No <Body> Fix

Mar 11th, 2015
254
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. #Edit the path below for your installation
  3. WP_PATH=/srv/www/cnx-software.com/public_html
  4. LOG_FILE=/tmp/qcache.log
  5. if [ -z $WP_PATH ]; then
  6.         echo "WP_PATH not set, please edit the script to define WP_PATH" >> $LOG_FILE
  7.         exit 0
  8. fi
  9. nobody_files=`grep -L body $WP_PATH/wp-content/cache/zencache/* -R | grep www-cnx`
  10. num_files=$((`echo "$nobody_files" | wc -l` - 1))
  11.  
  12. if [ $num_files = 0 ]
  13. then
  14.         echo "No cached file without <body> tag could be found" >> $LOG_FILE
  15. else
  16.         datedel=`date`
  17.         echo "$datedel: Deleting $num_files cache files without <body> tag" >> $LOG_FILE
  18.         rm $nobody_files
  19. fi
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement