WTF does that cron do?
I'll be the first to admit that I'm not a great system administrator. I was a windows guy for so long, so my only exposure to linux was haggling with shared hosting accounts to run my stupid php apps. While my linux/administration skills have grown by leaps and bounds in the last few years, I still get caught up on something as simple as cron jobs. The syntax is very terse, and probably easy to parse for computers. For the rest of us... Well, what the hell does this mean?
*/6 * * * * rake ts:index:delta
According to my new project, CronWTF, that "runs
rake ts:index:delta at minutes :00, :06, :12, :18, :24, :30, :36, :42, :48, :54, every hour."
Okay, to be honest, it's not that hard to read. Most of the time my jobs run multiple times a day, so I'm only dealing with the first 2 fields (minutes and hours). The real reason I wrote this was for punishment for royally botching up the cron job for the Calendar About Nothing.
I wanted to run the update task every four hours:
* */4 * * * rake seinfeld:update
Then, my server would periodically run out of memory and my host would have to reboot it. I happened to be on the server during one of these ruby storms and noticed a bunch of rake processes piling up. Then I parsed the crontab that I had written: Runs
rake seinfeld:update every minute, on hours 0, 4, 8, 12, 16, 20, every day.