PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > scripts with output
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

scripts with output

Réponse
 
LinkBack Outils de la discussion
Vieux 08/11/2007, 18h24   #1
droid
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut scripts with output

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?

  Réponse avec citation
Vieux 08/11/2007, 18h50   #2
CSGill@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: scripts with output

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


  Réponse avec citation
Vieux 09/11/2007, 04h23   #3
droid
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: scripts with output

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!

  Réponse avec citation
Vieux 12/11/2007, 14h54   #4
Scott McMillan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: scripts with output

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
  Réponse avec citation
Vieux 13/11/2007, 11h52   #5
droid
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: scripts with output

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.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 02h39.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10492 seconds with 13 queries