[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] PHP and crontab
- Subject: Re: [cobalt-users] PHP and crontab
- From: Kris Dahl <krislists@xxxxxxxxxxxxx>
- Date: Mon Jun 12 04:26:18 2000
on 6/12/00 11:51 AM, Dan at dan@xxxxxxxxxxxxx wrote:
>>
>> 0 0 * * * * curl http://www.yoursite.com/myscript.php3
>> 0 0 * * * * lynx -dump http://www.yoursite.com/myscript.php3
>> will every night at midnight will execute cURL (a killer command
>> line stdout
>> web browser/tool) or use Lynx to essentially do the same thing,
>> respectively.
>>
> I was looking for a method to call a CGI script on another server every day
> at a certain time. Would one of these accomplish that? Is curl something
> that's installed by default on a RAQ2?
Niether cURL nor Lynx come preinstalled on a Raq2. Perhaps Lynx is
installed on the Raq3. Wget may be installed on the Raq2.
> I tried the crontab:
>
> 20 14 * * * * curl http://www.domain.com/cgi-bin/script.cgi
>
> Then I received an email from the server:
>
> From: Cron Daemon
> Sent: Monday, June 12, 2000 2:20 PM
> Subject: Cron <admin@admin> * curl http://www.domain.com/cgi-bin/script.cgi
>
> /bin/sh: script.cgi: command not found
>
> Then I tried lynx -dump instead and got:
>
> From: Cron Daemon
> Sent: Monday, June 12, 2000 2:40 PM
> Subject: Cron <admin@admin> * lynx -dump
> http://www.domain.com/cgi-bin/script.cgi
>
>
> /bin/sh: script.cgi: command not found
>
> Any ideas?
I think that is my bad... I don't think that the cron likes the multiple
arguments there.
So what you should do is soemthing like create a file call it something like
/home/sites/home/users/admin/snag.sh:
#!/bin/sh
curl http://www.domain.com/cgi-bin/script.cgi
make sure it is chmod'd to be executable (like 755), and make sure it is
owned by the owner of the crontab.
then put
20 14 * * * * /home/sites/home/users/admin/snag.sh
in your crontab.
It should work, if you have either curl or lynx installed (using the
appropriate command, of course).
-k