LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cron output (https://www.linuxquestions.org/questions/linux-newbie-8/cron-output-847291/)

pgte3 11-29-2010 02:35 PM

cron output
 
When a redirect (">") is not used in a crontab statement (below), where does the output, messages, results etc go?

45 23 * * *
/home/anpacadmin/scripts/medicare/chk4response17373

acid_kewpie 11-29-2010 02:40 PM

The output is endless to the user defined in the mailto variable, usually root by default. This can cause some ugly situations when scripts are quite noisy and can easily fill up filesystems over time.

pgte3 11-29-2010 02:59 PM

In the below sample, is $HOME/backup.out mailed to dba?

#My Cron file.. User:MySQL
#use /bin/sh to run commands, overriding the default SHELL=/bin/sh
#
# mail any output to `dba'
MAILTO=dba
#
# fifteen minutes after midnight.. Backup it Up !!!
15 0 * * * $HOME/bin/backup.job >> $HOME/backup.out 2>&1


In my cron statement (previous post), I have no ">>", does that mean that there is nothing to mail? The output from the running a script goes?

pgte3 11-29-2010 03:11 PM

Should have included this in post, mailto variable is set to MAILTO=""

colucix 11-29-2010 03:35 PM

Quote:

Originally Posted by pgte3 (Post 4175077)
In my cron statement (previous post), I have no ">>", does that mean that there is nothing to mail?

Not really. The output can be redirected to a file inside the script itself. In that case there is nothing sent to the standard output (or the standard error) and redirection in the crontab entry is not necessary.
Quote:

Originally Posted by pgte3 (Post 4175077)
Should have included this in post, mailto variable is set to MAILTO=""

In this case the output is lost forever.

pgte3 11-30-2010 02:21 PM

ok thanks


All times are GMT -5. The time now is 12:23 AM.