You are here: Re: Multiple jobs from single cron. « PHP Programming Language « IT news, forums, messages
Re: Multiple jobs from single cron.

Posted by Captain Paralytic on 09/25/06 08:29

Jerry Stuckle wrote:
> Paul Lautman wrote:
> > Toby Inkster wrote:
> >
> >>Paul Lautman wrote:
> >>
> >>
> >>>Now I could just include the jobs into the one cron job, but if one
> >>>abended for any reason, then the second one wouldn't run.
> >>
> >>That's not the case.
> >>
> >>If you run:
> >>
> >>command 1; command 2; command 3
> >>
> >>then command 2 will run regardless of whether command 1 was
> >>successful or not; and command 3 will run regardless of whether
> >>either or both of the previous commands were successful.
> >>
> >>What you may be thinking of is:
> >>
> >>command 1 && command 2 && command 3
> >>
> >>which means only run command 2 if command 1 is successful, and only
> >>run command 3 if command 2 is.
> >>
> >>The third way of stringing together multiple commands into one is:
> >>
> >>command 1 & command 2 & command 3
> >>
> >>which will behave more or less the same as the first example, but it
> >>will run the commands in parallel instead of in serial.
> >
> >
> > I wasn't aware that I could do that with the commands, but I still don't
> > think it'l help. I only have a very simple interface into the cron file. I
> > can specify one command only and I suspect that the command length of the
> > interfac is restricted.
> >
> > When I spoke of including the jobs in one, I was meaning running a php
> > script with includes in it.
> >
> > What I'd really like is to have the php script that was run by cron, run
> > more scripts whose names it would get from a database table.
> >
> >
>
> Just set up a shell script to do whatever you commands you want and
> execute the shell script. No PHP necessary.
>
Hm, good idea. Because the actual jobs that I want to run are php I was
focussed on teh cron job being php too. Of course there is no reason
for it to be like that!

The main requirement is that an error (abend) in one job doesn't stop
any of the others from executing although being able to add the jobs in
a database rather than having to edit a shell script file would be nice
too. That was another reason for me thinking along the lines of the
initial job being written in php.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация