PhpDig.net

Go Back   PhpDig.net > General Forums > Coding & Tutorials

Reply
 
Thread Tools
Old 09-06-2005, 09:00 PM   #1
Brock
Green Mole
 
Join Date: Sep 2005
Posts: 4
Angry Cron problem, please help me!!!!

I'm making a cronjob for a client that will automaticly activate a php script everyday. I thought it would be easy, but I just cant get it to work.
Here's the error email I get:
/home/myname/public_html/test/test2.php: line 1: ?php: No such file or directory
/home/myname/public_html/test/test2.php: line 2: =works great: command not found
/home/myname/public_html/test/test2.php: line 3: =noreply@myemail.com: command not found
/home/myname/public_html/test/test2.php: line 4: syntax error near unexpected token `'myname@gmail.com','
/home/myname/public_html/test/test2.php: line 4: ` mail('myname@gmail.com', 'single test', $message, $from);'

Please help me, I'm new to all this and so frustrated.

Brock
Brock is offline   Reply With Quote
Old 09-07-2005, 07:06 AM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Assuming test2.php is the PHP script you want to run, you are not passing variables, and you have *nix shell access, make a cron.txt file with the following:
Code:
0 0 * * * /full/path/to/php -f /full/path/to/test2.php > /full/path/to/log.txt
That says to run test2.php and dump any output to log.txt at midnight of every day. Then type /full/path/to/crontab /full/path/to/cron.txt to set the cronjob.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 09-07-2005, 06:23 PM   #3
Brock
Green Mole
 
Join Date: Sep 2005
Posts: 4
Awesome, that fixed it. Thanks so much!
Brock is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron problem, please help me!!!! fwbbetsy Coding & Tutorials 1 09-21-2006 07:23 PM
alternative to Cron rkphpdev Coding & Tutorials 1 10-05-2005 07:23 AM
cron again xdaniel Bug Tracker 4 05-12-2005 08:33 AM
cron problem Warmbells Troubleshooting 4 12-23-2004 06:33 PM
Problem running cron job jerrywin5 Troubleshooting 1 04-10-2004 04:07 PM


All times are GMT -8. The time now is 08:00 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.