
How to “see” your automated cron jobs - coreymaass
http://gelform.com/blog/2011/09/how-to-see-your-automated-cron-jobs/
======
dazzawazza
I'm not sure what curl is doing here. I set the variable

MAILTO=me@example.com

in my crontab and the stdout/stderr are emailed to me everyday.

from man cron (FreeBSD 8.2)

"When executing commands, any output is mailed to the owner of the crontab (or
to the user named in the MAILTO environment variable in the crontab, if such
exists)."

~~~
covati
Exactly, this is what I do. His solutions seems like a bit too much duct tape
and not enough RTFM ;)

~~~
coreymaass
Hey, you gotta know the rules to break them. :-) I'd rather have more control
than rely on the mailto.

------
rick888
Another tip for automated cronjobs is if a job is going to go over the time
(IE: if you have it running every hour and it might run over an hour) use a
file lock to make sure they won't run at the same time.

~~~
lobster_johnson
Yep. I use the flock tool (comes with most Linux distros, I assume) for this:

flock -nx /var/run/myscript.lock /usr/bin/myscript

This will run the script while keeping a lock. If there is a lock, it will
quit immediately.

------
zwischenzug
To paraphrase Babbage:

I am not able to rightly apprehend the kind of confusion of ideas that could
provoke such a blog post.

------
sneak
Quick wrapper for the programs that won't shut up when everything is going ok:

<https://raw.github.com/sneak/misc/master/cronify/cronify>

------
TheHunter
and to think I spent all this time >/dev/null 2>&1

