command line - If we made a mistake in crontab entry what will happen then - Ask Ubuntu


if made mistake in crontab entry, issuing nonexistent command coppy instead of cp, happens upon execution of task?

first note that, each cron job run in shell (sh i.e. dash default, changeable via shell environment variable inside crontab). 2 cases:

  • mailto environment variable set: mail sent mentioned address(es) error (stderr) (and stdout, if any), if run in (used) shell

  • mailto environment variable null: nothing, error message thrown away no consumer available

  • mailto environment variable unset: stderr (and stdout if any) sent local user's mailbox

in cases, /var/log/syslog have relevant error message.


note people use shell redirections save stdout/stderr in file e.g.:

* * * * * your_command >/tmp/cron_msg 2>&1 

or if mailto set, not have stdout/stderr in mail teh primary intention run command, if common trend send /dev/null too:

* * * * * your_command >/dev/null 2>&1 

Comments

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User