I have a cron every two minutes (*/2 * * * *
) firing the following command…
wget "http://www.example.com/wp-cron.php?import_key=my_key_stringimport_id=16&action=trigger"
Trouble is, it is emailing me every two minutes, and also creating copious tiny files on the server, one each time.
I have tried several things. I know there is plenty of info out there about suppressing email feedback from cron.
cPanel’s Cron page, where my crons are set, makes clear: “If you do not want an email to be sent for an individual cron job, you can redirect the command’s output to /dev/null. For example: mycommand >/dev/null 2>&1
“
But when I did it like this…
wget -O "http://www.example.com/wp-cron.php?import_key=my_key_stringimport_id=16&action=trigger" >/dev/null 2>&1
… the cron stopped functioning.
(I believed an -O
was necessarily to direct the output).
What is the proper way to formulate this?
2
Answers
This seems to do the trick...
Ie. Add
--quiet
Answer found elsewhere on Stackoverflow.
Bit confused how
--quiet
and-O
co-exist.To suppress mails from cron you can add before your line in cron
MAILTO