Jacob Albretsen wrote:
On Wednesday 21 April 2004 14:22, Mark Gardner wrote:

I'm Running SUSE LINUX 9.0 Professional

How do I get a PHP script "script.php" to run as a cron job?  I want it
to run daily @ 3:00 AM


A nice front end to cron jobs is kcron. It's a KDE app, so I assume you can track it down for SuSE. In Mandrake, it's in the kdeadmin RPM.

http://docs.kde.org/en/3.1/kdeadmin/kcron/


You'll want to make your PHP script executable. To do this, make sure the permissions are set to allow you to execute it, then add


#!/usr/bin/php

as the first line of the file. You'll now be able to run the script from the command line by its name, instead of doing 'php filename.php'. Next set up a cron job to run the script. You could also skip the file altering part and make 'php filename.php' the command that cron executes.

-Brent

____________________
BYU Unix Users Group http://uug.byu.edu/ ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to