[PHP] Crontabs
I want to set up a crontab using my hosts control panel, and when i go to set one up there are boxes for how frequently you want the task to run, and one labelled Command. Basically, I want to get a PHP script to run every set amount of time, so what do I have to type in the Command box to get a PHP script to run? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Crontabs
Matthew: On Tue, Jun 18, 2002 at 08:48:19PM +0100, Matthew Ward wrote: Basically, I want to get a PHP script to run every set amount of time, so what do I have to type in the Command box to get a PHP script to run? If your script has the appropriate #! at the top, you can type in the path and name of the script. Say, /usr/home/username/dir/script.php for example. Make sure the script has it's owner executable permission set (chmod 700, for example). --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Crontabs
What do you mean by appropriate #! at the top? Analysis Solutions [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Matthew: On Tue, Jun 18, 2002 at 08:48:19PM +0100, Matthew Ward wrote: Basically, I want to get a PHP script to run every set amount of time, so what do I have to type in the Command box to get a PHP script to run? If your script has the appropriate #! at the top, you can type in the path and name of the script. Say, /usr/home/username/dir/script.php for example. Make sure the script has it's owner executable permission set (chmod 700, for example). --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Crontabs
He's referring to the script parser executable, ala: #!/bin/sh #!/usr/bin/perl In this case, you'd need the PHP cgi version installed, and do your script like this: #!/usr/bin/php -q ?php // your script ? Set the script to executable, then set up a crontab entry with the path to the script. -Clay From: Matthew Ward [EMAIL PROTECTED] Organization: Inspiration Studios Reply-To: Matthew Ward [EMAIL PROTECTED] Date: Tue, 18 Jun 2002 20:55:54 +0100 To: [EMAIL PROTECTED] Subject: Re: [PHP] Crontabs What do you mean by appropriate #! at the top? Analysis Solutions [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Matthew: On Tue, Jun 18, 2002 at 08:48:19PM +0100, Matthew Ward wrote: Basically, I want to get a PHP script to run every set amount of time, so what do I have to type in the Command box to get a PHP script to run? If your script has the appropriate #! at the top, you can type in the path and name of the script. Say, /usr/home/username/dir/script.php for example. Make sure the script has it's owner executable permission set (chmod 700, for example). --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Crontabs
On Tue, Jun 18, 2002 at 08:55:54PM +0100, Matthew Ward wrote: What do you mean by appropriate #! at the top? When you write a script that you want to be executable, you put in the pound bang at the top, telling the operating system which program to use to run the script. So, for example, a php script could start something like: #! /usr/local/bin/php ?php Or a perl script could open up with #! /usr/local/bin/perl These lines need to be set to the actual path/file name used on the system it'll be executed on. Enjoy, --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Crontabs
You can use lynx as a command, just like that : lynx http://username:password@localhost/secure/script.php; Rémy Dufour I want to set up a crontab using my hosts control panel, and when i go to set one up there are boxes for how frequently you want the task to run, and one labelled Command. Basically, I want to get a PHP script to run every set amount of time, so what do I have to type in the Command box to get a PHP script to run? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Crontabs
Like someone else said, this applies if PHP is compiled as a cgi and you can run it from the command line. If it's a module, you have to load up your page through a web browser to run it. So for your command, you can use lynx --dump http://www.domain.com/whatever.php providing you have lynx installed. You can use wget, too. Your script shouldn't produce any output unless you send it to a file or somewhere. ---John Holmes... - Original Message - From: Analysis Solutions [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Tuesday, June 18, 2002 4:09 PM Subject: Re: [PHP] Crontabs On Tue, Jun 18, 2002 at 08:55:54PM +0100, Matthew Ward wrote: What do you mean by appropriate #! at the top? When you write a script that you want to be executable, you put in the pound bang at the top, telling the operating system which program to use to run the script. So, for example, a php script could start something like: #! /usr/local/bin/php ?php Or a perl script could open up with #! /usr/local/bin/perl These lines need to be set to the actual path/file name used on the system it'll be executed on. Enjoy, --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php