scripts with output
am 08.11.2007 19:24:44 von droid
Over several years, I have built-up a suite of backup scripts. The
scripts report errors and other status to the console using 'echo',
'ls' and 'cat'. I would like to run these as a cron job. Will output
to stdout cause
problems or just be ignored?
Re: scripts with output
am 08.11.2007 19:50:46 von CSGill
On Nov 8, 12:24 pm, droid wrote:
> Over several years, I have built-up a suite of backup scripts. The
> scripts report errors and other status to the console using 'echo',
> 'ls' and 'cat'. I would like to run these as a cron job. Will output
> to stdout cause
> problems or just be ignored?
by default output of stdout and stderr are emailed to the running user
of the cron... you can disable this by adding MAILTO="" to the
beginning of your cron, in which case stdout and stderr will go
nowhere... or you could go through your scripts and redirect stdout
and stderr to /dev/null
Re: scripts with output
am 09.11.2007 05:23:32 von droid
On Nov 8, 1:50 pm, CSG...@gmail.com wrote:
>
> by default output of stdout and stderr are emailed to the running user
> of the cron... you can disable this by adding MAILTO="" to the
> beginning of your cron, in which case stdout and stderr will go
> nowhere... or you could go through your scripts and redirect stdout
> and stderr to /dev/null
Very instructive - thanks!
Re: scripts with output
am 12.11.2007 15:54:21 von Scott McMillan
On 8 Nov 2007 10:24:44 -0800, droid wrote:
>Over several years, I have built-up a suite of backup scripts. The
>scripts report errors and other status to the console using 'echo',
>'ls' and 'cat'. I would like to run these as a cron job. Will output
>to stdout cause
>problems or just be ignored?
Wouldn't you want these to be placed into a log file instead of going
where nobody will see them? For example
/path/to/your_script >/path/to/your_logfile 2>&1
Scott McMillan
Re: scripts with output
am 13.11.2007 12:52:11 von droid
On Nov 12, 9:54 am, Scott McMillan wrote:
>
> Wouldn't you want these to be placed into a log file instead of going
> where nobody will see them? For example
>
> /path/to/your_script >/path/to/your_logfile 2>&1
>
Good idea, Scott! stderr has always been re-directed to an error log;
so I could just redirect my own error reporting there.