Silent Curl in CRON jobs

I have lots of CRON jobs. Some of them are just to probe our services to make sure they are alive, some download third party data via curl. Either way curl gets used in a fair number of them.

When a job produces output it will email the primary cron email contact. This becomes noisy and hard to really tell, what is wrong and what is not, and when failures occur.

To get curl to suppress it’s messages pass the -s option, then either set the output file parameter, or pipe the STDOUT output to /dev/null to get it to quiet down, but still produce STDERR output to the cron email contact.

if these flags don’t help you, check out the man page for your version of curl, I’d search for silent, and output to see what is new and changed.

 
1
Kudos
 
1
Kudos

Now read this

Deploy Diary #1

Deploying Rails 4 to multiple web heads with Capistrano 3, with sidekiq and rbenv I’m working on a project that gives me an interesting time to play around with this hosting model. I’m not an expert yet, but this article and the rest in... Continue →