Skip to main content
replaced http://serverfault.com/ with https://serverfault.com/
Source Link

Sounds like this is fixed. Next time, try logging the STDERR as well. The following will only log to STDOUT, not STDERR:

* * * * * echo hi >> /home/myusername/test

Try to make sure there is an explicit clause for STDERR as well. Otherwise, STDERR may be sent via email to the user (assuming that email is working) or may go nowhere at all, depending on how Cron is configured.

* * * * * echo hi >> /home/myusername/test 2> /home/myusername/test.stderr

My preferenceMy preference is to send cronjob output to syslog. That way I am taking advantage of any existing syslog infrastructure (centralized syslogs, Splunk, log rotation already supported, it's easy to compare messages in /var/log/messages & /var/log/cronjob, etc), and I'm not spamming the sysadmins (me) with unnecessary emails.

* * * * * echo hi >> /home/myusername/test 2>&1 | /usr/bin/logger -t mycronjob

Sounds like this is fixed. Next time, try logging the STDERR as well. The following will only log to STDOUT, not STDERR:

* * * * * echo hi >> /home/myusername/test

Try to make sure there is an explicit clause for STDERR as well. Otherwise, STDERR may be sent via email to the user (assuming that email is working) or may go nowhere at all, depending on how Cron is configured.

* * * * * echo hi >> /home/myusername/test 2> /home/myusername/test.stderr

My preference is to send cronjob output to syslog. That way I am taking advantage of any existing syslog infrastructure (centralized syslogs, Splunk, log rotation already supported, it's easy to compare messages in /var/log/messages & /var/log/cronjob, etc), and I'm not spamming the sysadmins (me) with unnecessary emails.

* * * * * echo hi >> /home/myusername/test 2>&1 | /usr/bin/logger -t mycronjob

Sounds like this is fixed. Next time, try logging the STDERR as well. The following will only log to STDOUT, not STDERR:

* * * * * echo hi >> /home/myusername/test

Try to make sure there is an explicit clause for STDERR as well. Otherwise, STDERR may be sent via email to the user (assuming that email is working) or may go nowhere at all, depending on how Cron is configured.

* * * * * echo hi >> /home/myusername/test 2> /home/myusername/test.stderr

My preference is to send cronjob output to syslog. That way I am taking advantage of any existing syslog infrastructure (centralized syslogs, Splunk, log rotation already supported, it's easy to compare messages in /var/log/messages & /var/log/cronjob, etc), and I'm not spamming the sysadmins (me) with unnecessary emails.

* * * * * echo hi >> /home/myusername/test 2>&1 | /usr/bin/logger -t mycronjob
added 81 characters in body
Source Link
Stefan Lasiewski
  • 20.8k
  • 25
  • 72
  • 86

Sounds like this is fixed. Next time, try logging the STDERR as well. Instead ofThe following will only log to STDOUT, not STDERR:

* * * * * echo hi >> /home/myusernaemyusername/test

Try to make sure there is an explicit locationclause for STDERR as well. Otherwise, STDERR may be sent via email to the user (assuming that email is working), or may go nowhere at all, depending on how Cron is configured.

* * * * * echo hi >> /home/myusernaemyusername/test 2> /home/myusername/test.stderr

My preference is to send cronjob output to syslog. That way I am taking advantage of any existing syslog infrastructure (centralized syslogs, Splunk, log rotation already supported, it's easy to compare messages in /var/log/messages & /var/log/cronjob, etc), and I'm not spamming the sysadmins (me) with unnecessary emails.

* * * * * echo hi >> /home/myusernaemyusername/test 2>&1 | /usr/bin/logger -t mycronjob

Sounds like this is fixed. Next time, try logging the STDERR as well. Instead of

* * * * * echo hi >> /home/myusernae/test

Try to make sure there is an explicit location for STDERR. Otherwise, STDERR may be sent via email to the user (assuming that email is working), or may go nowhere at all.

* * * * * echo hi >> /home/myusernae/test 2> /home/myusername/test.stderr

My preference is to send cronjob output to syslog. That way I am taking advantage of any existing syslog infrastructure (centralized syslogs, Splunk, log rotation already supported, it's easy to compare messages in /var/log/messages & /var/log/cronjob, etc), and I'm not spamming the sysadmins (me) with unnecessary emails.

* * * * * echo hi >> /home/myusernae/test 2>&1 | /usr/bin/logger -t mycronjob

Sounds like this is fixed. Next time, try logging the STDERR as well. The following will only log to STDOUT, not STDERR:

* * * * * echo hi >> /home/myusername/test

Try to make sure there is an explicit clause for STDERR as well. Otherwise, STDERR may be sent via email to the user (assuming that email is working) or may go nowhere at all, depending on how Cron is configured.

* * * * * echo hi >> /home/myusername/test 2> /home/myusername/test.stderr

My preference is to send cronjob output to syslog. That way I am taking advantage of any existing syslog infrastructure (centralized syslogs, Splunk, log rotation already supported, it's easy to compare messages in /var/log/messages & /var/log/cronjob, etc), and I'm not spamming the sysadmins (me) with unnecessary emails.

* * * * * echo hi >> /home/myusername/test 2>&1 | /usr/bin/logger -t mycronjob
Source Link
Stefan Lasiewski
  • 20.8k
  • 25
  • 72
  • 86

Sounds like this is fixed. Next time, try logging the STDERR as well. Instead of

* * * * * echo hi >> /home/myusernae/test

Try to make sure there is an explicit location for STDERR. Otherwise, STDERR may be sent via email to the user (assuming that email is working), or may go nowhere at all.

* * * * * echo hi >> /home/myusernae/test 2> /home/myusername/test.stderr

My preference is to send cronjob output to syslog. That way I am taking advantage of any existing syslog infrastructure (centralized syslogs, Splunk, log rotation already supported, it's easy to compare messages in /var/log/messages & /var/log/cronjob, etc), and I'm not spamming the sysadmins (me) with unnecessary emails.

* * * * * echo hi >> /home/myusernae/test 2>&1 | /usr/bin/logger -t mycronjob