SHOW:
|
|
- or go back to the newest paste.
1 | #!/bin/bash | |
2 | #Edit the path below for your installation | |
3 | - | WP_PATH= |
3 | + | WP_PATH=/srv/www/cnx-software.com/public_html |
4 | LOG_FILE=/tmp/qcache.log | |
5 | - | echo "WP_PATH not set, please edit the script to define WP_PATH" |
5 | + | |
6 | echo "WP_PATH not set, please edit the script to define WP_PATH" >> $LOG_FILE | |
7 | exit 0 | |
8 | - | nobody_files=`grep -L body $WP_PATH/wp-content/cache/qc-c-*` |
8 | + | |
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 | - | if [ $num_files == 0 ] |
11 | + | |
12 | if [ $num_files = 0 ] | |
13 | - | echo "No cached file without <body> tag could be found" |
13 | + | |
14 | echo "No cached file without <body> tag could be found" >> $LOG_FILE | |
15 | - | echo "Deleting $num_files cache files without <body> tag" |
15 | + | |
16 | datedel=`date` | |
17 | echo "$datedel: Deleting $num_files cache files without <body> tag" >> $LOG_FILE | |
18 | rm $nobody_files | |
19 | fi |