|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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? |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Nov 8, 12:24 pm, droid <jshowal...@gmail.com> 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 |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
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! |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On 8 Nov 2007 10:24:44 -0800, droid <jshowalter@gmail.com> 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 |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
On Nov 12, 9:54 am, Scott McMillan <smcmil...@twmi.rr.com> 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. |
|
![]() |
| Outils de la discussion | |
|
|