RE: [PHP] Crontab PHP Script
Just some closure on my crontab question: 1 - Since my linux box has Plesk 7 (PSA) and it already had php installed on it I guess php is installed in the /usr/local/psa/admin/bin/php directory. Pretty sure atleast since the below crontab command is now executing my script: /usr/local/psa/admin/bin/php /home/httpd/vhosts/tgwedding.com/httpdocs/tgwedding/crontab.php I believe traditionally php is installed in /usr/local/bin/php but I could be wrong...this is what was throwing me off. 2 - Tim, you were right, all stars will make the crontab run every minute on my linux box -Original Message- From: Tim Traver [mailto:[EMAIL PROTECTED] Sent: Sunday, June 27, 2004 1:17 AM To: Ryan Schefke; Php-General-Help; [EMAIL PROTECTED] Subject: Re: [PHP] Crontab PHP Script Not sure if this is different in linux, but usually the first parameter is the minutes, and if you had 01 in it, that means that it would do it once an hour (i.e. 12:01, 1:01, 2:01, etc... They should all have stars to do it once a minute. In freeBSD, it would look like this : * * * * root/usr/local/bin/php home/httpd/vhosts/tgwedding.com/httpdocs/tgwedding/crontab.php Tim. At 04:34 PM 6/26/2004, Ryan Schefke wrote: Hi, Can someone please give me some guidance. I'd like to run a php script every minute (in reality every night, but just testing). I've done some reading and found that a crontab is the best way to go (I think). I'm using Plesk 7 on a Linux box and I have root access. I made a quick php script called crontab.php to email me. == ?php //send email on domain /* subject */ $str_subject = crontab test; /* message */ $messagecontent = this is a test to see if crontab working nightly\n\n; /* to */ $to = [EMAIL PROTECTED]; /* from */ $headers .= From: tgWedding [EMAIL PROTECTED]\r\n; /* bcc */ // $headers .= Bcc: [EMAIL PROTECTED]; mail($to, $str_subject, $messagecontent, $headers); ? Then I setup my crontab command as: /home/httpd/vhosts/tgwedding.com/httpdocs/tgwedding/crontab.php https://217.160.251.56:8443/sysuser/crontab_edit.php?cte_src=CTEJKgkqCSoJK g kvaG9tZS9odHRwZC92aG9zdHMvdGd3ZWRkaW5nLmNvbS9odHRwZG9jcy90Z3dlZGRpbmcvY3Jvb n RhYi5waHA= I used * for every field except M, which I set to 01 to run every minute. It's not working...can someone guide me along and let me know what I've done wrong. Thanks, Ryan SimpleNet's Back ! http://www.simplenet.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Crontab PHP Script
Hi, Can someone please give me some guidance. I'd like to run a php script every minute (in reality every night, but just testing). I've done some reading and found that a crontab is the best way to go (I think). I'm using Plesk 7 on a Linux box and I have root access. I made a quick php script called crontab.php to email me. == ?php //send email on domain /* subject */ $str_subject = crontab test; /* message */ $messagecontent = this is a test to see if crontab working nightly\n\n; /* to */ $to = [EMAIL PROTECTED]; /* from */ $headers .= From: tgWedding [EMAIL PROTECTED]\r\n; /* bcc */ // $headers .= Bcc: [EMAIL PROTECTED]; mail($to, $str_subject, $messagecontent, $headers); ? Then I setup my crontab command as: /home/httpd/vhosts/tgwedding.com/httpdocs/tgwedding/crontab.php https://217.160.251.56:8443/sysuser/crontab_edit.php?cte_src=CTEJKgkqCSoJKg kvaG9tZS9odHRwZC92aG9zdHMvdGd3ZWRkaW5nLmNvbS9odHRwZG9jcy90Z3dlZGRpbmcvY3Jvbn RhYi5waHA= I used * for every field except M, which I set to 01 to run every minute. It's not working...can someone guide me along and let me know what I've done wrong. Thanks, Ryan
Re: [PHP] Crontab PHP Script
Ryan Schefke wrote --- napĂsal:: Hi, Can someone please give me some guidance. I'd like to run a php script every minute (in reality every night, but just testing). I've done some reading and found that a crontab is the best way to go (I think). I'm using Plesk 7 on a Linux box and I have root access. Then I setup my crontab command as: /home/httpd/vhosts/tgwedding.com/httpdocs/tgwedding/crontab.php The crontab command should be: /path/to/php /path/to/your/crontab.php Add -q parameter if the php executable is cgi and not cli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Crontab PHP Script
On Sat, 2004-06-26 at 19:34, Ryan Schefke wrote: Hi, Can someone please give me some guidance. I'd like to run a php script every minute (in reality every night, but just testing). I've done some reading and found that a crontab is the best way to go (I think). I'm using Plesk 7 on a Linux box and I have root access. You need to add #!/usr/bin/php At the start of your script so it knows how to run it. You will also need to set the permission bits to allow execution chmod 700 Change the path to where you have the cli version of php on your system. -- Scot L. Harris [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Crontab PHP Script
Not sure if this is different in linux, but usually the first parameter is the minutes, and if you had 01 in it, that means that it would do it once an hour (i.e. 12:01, 1:01, 2:01, etc... They should all have stars to do it once a minute. In freeBSD, it would look like this : * * * * root/usr/local/bin/php home/httpd/vhosts/tgwedding.com/httpdocs/tgwedding/crontab.php Tim. At 04:34 PM 6/26/2004, Ryan Schefke wrote: Hi, Can someone please give me some guidance. I'd like to run a php script every minute (in reality every night, but just testing). I've done some reading and found that a crontab is the best way to go (I think). I'm using Plesk 7 on a Linux box and I have root access. I made a quick php script called crontab.php to email me. == ?php //send email on domain /* subject */ $str_subject = crontab test; /* message */ $messagecontent = this is a test to see if crontab working nightly\n\n; /* to */ $to = [EMAIL PROTECTED]; /* from */ $headers .= From: tgWedding [EMAIL PROTECTED]\r\n; /* bcc */ // $headers .= Bcc: [EMAIL PROTECTED]; mail($to, $str_subject, $messagecontent, $headers); ? Then I setup my crontab command as: /home/httpd/vhosts/tgwedding.com/httpdocs/tgwedding/crontab.php https://217.160.251.56:8443/sysuser/crontab_edit.php?cte_src=CTEJKgkqCSoJKg kvaG9tZS9odHRwZC92aG9zdHMvdGd3ZWRkaW5nLmNvbS9odHRwZG9jcy90Z3dlZGRpbmcvY3Jvbn RhYi5waHA= I used * for every field except M, which I set to 01 to run every minute. It's not working...can someone guide me along and let me know what I've done wrong. Thanks, Ryan SimpleNet's Back ! http://www.simplenet.com