Cavalcade job and log cleanup
The cavalcade MySQL tables get very large over time, which I think contributes somewhat to performance issues. They can use periodic cleanup.
1. wp_cavalcade_logs should be purged occasionally. There's no reason to have hot storage of more than a few weeks' worth of logs. I'm currently doing it manually every couple weeks (export table, then delete everything except the last few weeks).
2. wp_cavalcade_jobs collects many jobs in the 'completed' or 'failed' status. There's generally no reason to keep these (except for debugging) and we should delete them on at least a weekly basis. https://github.com/humanmade/Cavalcade/issues/72
These tasks are easily performed via wp cli, which we could then rig up to a cron job.
#1 Updated by Boone Gorges 2 months ago
- File cavalcade-jobs-rotate.sh cavalcade-jobs-rotate.sh added
- File cavalcade-logs-rotate.sh cavalcade-logs-rotate.sh added
- Status changed from New to Resolved
- Target version changed from 1.15 to 1.14.3
I decided to tackle this earlier, since it's not tied to a specific release. The two scripts are attached. They're set to run early on Sunday mornings. I'll confirm that the cron jobs are running correctly on Monday. Backups are in /home/GC/bgorges/cavalcade-backups, should we ever need them. I'll manually purge this directory once a year or so.