I’m super pleased with getting cogdogblog.com hoisted to the cloud, and I admit I have no good clue how everything works.
On my shared host version, I had set up a cron job o regularly delete comments flagged as spam from my database, keeping it clean from cruft. My cronjob command was:
mysql -u blog -p{password} --database={dbname} -Bse "DELETE FROM wp_comments WHERE comment_approved = 'spam'"
You can open a terminal in the environment on Reclaim Cloud, then:
crontab -e
To edit the cron just like most linux boxes, or if you want to avoid the terminal or vim, you can do it from the “config” tool on Reclaim Cloud. Click on the wrench, then the cron bookmark in the sidebar, then double click on litespeed to edit that file.
Yep! Sounds like it’s working but there are a few other ways to test:
In general to test out a cron job I’ll try first running it in the terminal (without the timing info) and then I’ll try scheduling the cron to run frequently, like every minute but take its output and write it to a file I can examine.
Here’s an example of setting that command to run every minute but to write all of its output (if it has any standard error or standout out) to a file at /home/litespeed/delete_blog_spam_cron.log
* * * * * mysql -u blog -p{password} --database={dbname} -Bse "DELETE FROM wp_comments WHERE comment_approved = 'spam'" > /home/litespeed/delete_blog_spam_cron.log 2>&1
If something is going wrong I’d expect to see some error(s) in the file. Once it’s working you can add just the schedule back to a more reasonable one instead of every minute.