Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Open Source > Linux
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Linux General discussion of programming the various flavors of Linux operating systems.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Linux section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 28th, 2005, 11:37 AM
Registered User
 
Join Date: Jul 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cron Job Error - Need Help

Hello,

I'm trying to set up my very first cron job.It's a simple little .php script that mails customers who ordered from me 10 days ago. Here is what I have in the cron job manager area of CPanel:

30 11 * * * /home/pipsquea/www/thanx.php

When it ran I was emailed the error:

/bin/sh: line 1: 30: command not found


I have no idea what this means or how to fix it. Is my syntax wrong? If anyone can give me some very basic advice on how to fix this problem I would be grateful.

Jennifer
Reply With Quote
  #2 (permalink)  
Old August 1st, 2005, 01:09 PM
Friend of Wrox
 
Join Date: Mar 2004
Location: Bhopal, MP, India.
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

Use this for command:

GET http://www.mysite.com/path_to_file/file.php > /dev/null

http://www.mediasworks.com/tutorial/

Ask me time related fields, if you don't understand.

http://www.mediasworks.com/
Reply With Quote
  #3 (permalink)  
Old August 5th, 2005, 05:51 AM
Friend of Wrox
Points: 1,515, Level: 15
Points: 1,515, Level: 15 Points: 1,515, Level: 15 Points: 1,515, Level: 15
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: Oxford, , United Kingdom.
Posts: 488
Thanks: 0
Thanked 3 Times in 3 Posts
Default

What is happening is that linux doesn't know how to run a .php file natively.

You need to install the php command line interpreter (CLI) and EITHER

rewrite your cron job as follows:

30 11 * * * php /home/pipsquea/www/thanx.php

OR keep the cron job the same and insert the following at the very top of your .php file:

#!/usr/bin/php -q

There's a tutorial here:

http://www.devarticles.com/c/a/PHP/PHP-CLI-and-Cron

--
Don't Stand on your head - you'll get footprints in your hair
                                           http://charlieharvey.org.uk
                                              http://charlieharvey.com
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron Job mani_he Linux 4 December 16th, 2010 07:02 AM
Windows cron job hsauer VB How-To 0 August 9th, 2006 11:40 AM
Cron job error ganesh15 Linux 1 October 22nd, 2003 04:04 AM
Cron job for a php-file nineball9 PHP How-To 2 October 21st, 2003 04:58 PM
Cron Job... Urgent ganesh15 Linux 2 September 19th, 2003 01:40 AM



All times are GMT -4. The time now is 01:25 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.