• I run daily backups of my entire wordpress directory, and don’t want to backup cached files. I would therefore like to empty the cache right before running the backup. In this other thread I see a statement that one could just delete the contents of wp-content/cache. But I’m wondering if running removing the contents and subdirectories of wp-content/cache is OK to do, as there is a .htaccess file, and I’m not sure whether it will be replaced automatically.

    Any help as to my question, or a better way of deleting all the cached files by cron job would be greatly appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • What are you using to run the backup? Most utilities to do this, like rsync, allow you to define files to exclude. For rsync, adding the following to your command would cause it to skip all cached files during the backup:

    rsync --exclude='wp-content/cache/'

    Thread Starter epuryear2

    (@epuryear2)

    Thanks smoothmoniker, although I’m not sure that will resolve the problem. I manually make my own backups and could exclude the ‘wp-content/cache/ directory, but my cpanel automated backups wouldn’t exclude the cache directory.

    Also, even for my own backup script, I’m not sure excluding would work well. This is because I have another script that automatically restores the backup to another server to limit down time, in the event of a major hardware failure. Not having the wp-content/cache directory would seem to interfere with this operation. I”m sure I could find a work-around for that particular issue, but I would much rather have some way of clearing the cache right before running my backup…

    Any suggestions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WP Super Cache] Deleting Cache Files by Cron Job’ is closed to new replies.