On my Ubuntu-Desktop and on my debian-server I have a script which needs to be executed each minute (a script that calls the minute-tic of my space online browsergame).
The problem is that on debian derivates cron is logging to
/var/log/syslog each time it executes. I end up seeing repeated the message it was executed over and over in
Nov 11 16:50:01 eclabs /USR/SBIN/CRON: (root) CMD (/usr/bin/w3m -no-cookie http://www.spacetrace.org/secret_script.php > /dev/null 2>&1)
I know that in order to suppress the output of a program I can redirect it to
/dev/null, for example to hide all error and warning messages from a program I can create a line in crontab like this
* * * * * root /usr/local/sbin/mycommand.sh > /dev/null
But I would like to run a cronjob and be sure that all generated output or errors are piped to NULL, so it doesn't generate any messages in syslog and doesn't generate any emails
there is a solution to redirect the cron-logs into a separate log like proposed here by changing
But the drawback is, that then ALL output of all cronjobs is redirected.
Can I somehow only redirect a single cronjob to a separate log file? Preferably configurable inside the
cron.hourly file itself.