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

Re: [cobalt-users] RaQ4i: Running ASP via CRONTAB



"Richard Abrams" <richard@xxxxxxxxxxxxxx> wrote:
> I would like to perform an automated mySQL database update on a RaQ4i.
> Ideally this would be a Perl script, however the RaQ in question isn't one
> of ours and lacks the requisite modules to connect.

I assume you mean DBI and the MySQL drivers.  You can always install them.

> Therefore I would like
> to write the job in ASP (simple enough) and schedule it to run daily using
> CRONTAB. There are 2 methods described in the archives; using wget
directly
> in the schedule
> (http://list.cobalt.com/pipermail/cobalt-users/2001-May/044936.html) or

Didn't read the above, but you can use wget or lyxn if you don't mind
calling via the web (requires web server to be up and accessible and allows
the public access to the script unless it's protected by .htaccess or
requires a form POST).

> writing a short perl script to create a user agent
> (http://list.cobalt.com/pipermail/cobalt-users/2002-May/070158.html).
>
> Any comments on a preferable method or a better way around (i.e. I
_believe_
> you can run PHP scripts directly from CRON by making them executable).

If you run the commandline version of PHP for a given script then you can
call it directly instead of via the web.  Just put this at the top of your
PHP script:

#!/usr/bin/php

and make it executable (chmod) by the user that will be running it.
'whereis php' if that's not the location of your PHP binary and if it's not
installed, download the source distro and compile as a CGI (default
install).  I run PHP scripts like this from cron all the time.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/