Re: Multiple jobs in crontab

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Al wrote:
> Richard Lynch wrote:
>
>> Al wrote:
>>
>>>I'm trying to run 3 jobs in a crontab and only one job will run.  I can
>>>rearrange the order and only the first one runs.
>>
>>
>> Try setting the MAILTO and check the output -- Perhaps that will tell
>> you
>> something useful...
>>
> Super suggestion.....
>
> It clearly showed I had a syntax error, forgot the "/htdocs/".  Betcha, I
> looked
> at the command 50 times and didn't see it.
>
> The MAILTO only seems to work when the cronjob doesn't run satisfactory. I
> assume this is because I have a log and error specified.

I believe the default is to email to the username (on the local machine)
any output from that user's cron file.

But, if you're not READING the email on that machine as that username, it
don't do much good.

Or, if that machine doesn't have sendmail running to actually SEND the
email...

I have that on one machine, and keep forgetting to fix it, and then every
once in awhile have to go un-clog /var/mail/mqueue or whatever it is.

So I need a cron job to run sendmail every once in a while, I guess...

> I plan to add MAILTO to all my future cronjobs, it can help greatly when
> debugging.

I actually leave it on, so that if something BREAKS in my cron jobs, I
hear about it.

Got a whole email mailbox set up with filtering just to sort the cron jobs
into it.  Every day I delete the cron jobs that are "in progress" or where
I use the output to give me a status message of what's going on in the
long-term projects that are being fueled by cron.

Deleting an email is easy.  Knowing that a cron job suddenly stopped
working is very difficult, unless you got that email about it. :-)

Ideally, you write your cron scripts to produce *NO* output unless
something is wrong.  And useful debugging output when something does go
wrong.

Another Tip:
When things aren't working, use crontab -l to see the crontab, and then
copy paste the command and see what happens.

Oooh, and be sure you did 'cd' to be in your home directory before you do
that, just to be sure you have full pathnames everywhere.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux