Re: Question about cron job

2008-04-04 Thread omer
Le Friday 04 April 2008 11:53:48 Pete Kay, vous avez écrit :
> Hi,
>
> Is there any utility that can help me to check the cron jobs that are
> currently running under Linux?
> If there is one, would you please kindly let me know?
>

If you mean the jobs which are effectively running, any process viewer will do 
the trick (ps, pstree...). These jobs always run as a child process of the 
cron daemon. If you just want to list the scheduled jobs, use crontab -l or 
read your crontab. There are also some logs  when a job is started but I 
don't remember where (dmesg, maybe?)

-- 
Cédric Lucantis



Re: Silent Cron Jobs

2008-03-27 Thread omer
Hi,

>
> I tried to whip up a small cron job, I put a short script
> in /etc/cron.daily thinking that this would work.
>
> Well, yes, it works, but I get mail sent to me by cron explaining that
> the job executed successfully.
>
> I'd prefer not to get the mail. I don't get mail for any of the other
> jobs in cron.daily, and I don't understand enough of bash scripting
> to see how mine is different from the others.
>
> If all else fails I could just add a line to /etc/crontab, but I think
> the Debian way is so very much better coordinated and elegant.

just add this line at the beggining of your script :

exec >/dev/null

this will discard any standard output and should be enough (you only get a 
mail when your program produces some output). You can also discard stderr by 
adding 2>&1 at the end of this line, but this is not a good idea as you could 
miss some important error message.

-- 
Cédric Lucantis