Cronjob heatmap or visualizer

Not exactly what you want, but for cronjobs I don't really care about when runs, as long as they run, I tend to prepend my command with a random sleep, such as this:

Code:
0 */6 * * * sleep $(shuf -i 0-1800 -n 1) && some command here
 
Hi Kristian,

Thanks for your reply. I wish I could do that too ;-)

But at the moment I have more then 30 cronjobs (and still more to come) for handling api-calls, importing, exporting and syncing data.
For 2 clients in 1 project.
They depend on each other and also need to take in account the limit/quota's of the api-calls.

We did consider making our own scheduler, but we thought that we would not need it. So it grew out of hand. And I do not have the time to invest in it.

So a visualizer would help a bit. An more advanced scheduler would be even better.

Greetz
 
How about this hacky oneliner:

Code:
# grep "CRON\[" /var/log/syslog | tr ":" " " | awk '{print $3" "$4" "$8}' | sort -k1,1n -k2,2n -k3,3 | uniq -c | sort -n

or just for a single user (root):

# grep "CRON\[.*\(root\)" /var/log/syslog | tr ":" " " | awk '{print $3" "$4" "$8}' | sort -k1,1n -k2,2n -k3,3 | uniq -c | sort -n

It's not pretty, but at least it would give you an indication of when there's most activity (assuming cronjobs are logged to syslog of course).
 
Nice idea tx!!

I tried the single user variant and had to change it to:

Bash:
grep "CROND\[.*\(admin\)" /var/log/cron | tr ":" " " | awk '{print $3" "$4" "$8}' | sort -k1,1n -k2,2n -k3,3 | uniq -c | sort -n

The logfile is different and the command is: CROND and I had a different user.
It gives a very long list ?

I have also database-logs, maybe I will make a view for this.

Thanks for the idea!
Still hoping for a plugin ?
 
Back
Top