[lug] Shell/Cron and passing args

Chip Atkinson chip at rmpg.org
Thu Jan 30 13:16:47 MST 2003


Hi John.

Are you trying to take the output of make_featured.php with an argument of
links?  If so, you probably want to use back ticks.  I believe that cron
uses sh rather than bash.

Chip

 On 30 Jan 2003, John Starkey wrote:

> Hello all. I've got a PHP shell script that I'm running perfectly fine
> in a normal shell, but I can't get it to run with cron.
>
> Basically, it's a script that writes several includes for a web page.
> Each are fairly common, so I've got one script and I'm trying to pass it
> arguments, with different cron entries. I can pass the arguments fine in
> a shell, but cron isn't happy.
>
> This is the shell command:
>
> /path/to/make_featured.php links
>
> no problem. But if I do:
>
> 01 00 * * * /path/to/phpbin < /path/to/make_featured.php links >
> /path/to/log/cron 2>&1
>
> it fails saying the argument 'links' isn't seen.
>
> The only fix I can find is to create a bash wrapper for it. Does anyone
> know what I'm doing wrong, before I create 2 scripts to do the work of
> one?
>
> Thanks much,
>
> John
>
>




More information about the LUG mailing list