tbsweb Posted July 10, 2007 Share Posted July 10, 2007 I have received this in my email for the cron job I setup is there something wrong?? Subject: Cron <tbs@optimus> 0 9 * * * php -q /home/tbs/public_html/whmcs/admin/cron.php Date: Tue, 10 Jul 2007 03:00:01 +0100 /bin/sh: 0: command not found 0 Quote Link to comment Share on other sites More sharing options...
trine Posted July 10, 2007 Share Posted July 10, 2007 how exactly did you enter it? the command is actually: php -q /home/tbs/public_html/whmcs/admin/cron.php and the 0 9 * * * is the time, in this case 9 AM, of every day of the year. 0 Quote Link to comment Share on other sites More sharing options...
tbsweb Posted July 10, 2007 Author Share Posted July 10, 2007 exactly as it is written. does it mean there is a prob when its emailing me that? 0 Quote Link to comment Share on other sites More sharing options...
joe123 Posted July 11, 2007 Share Posted July 11, 2007 yes there is a problem and it means it didn't work. your cron job should start with /path/to/php and not just "php" something that looks like /usr/bin/php 0 Quote Link to comment Share on other sites More sharing options...
tbsweb Posted July 11, 2007 Author Share Posted July 11, 2007 this is what it says in auto config settings: Create the following Cron Job using PHP: 0 9 * * * php -q /home/tbs/public_html/whmcs/admin/cron.php OR 0 Quote Link to comment Share on other sites More sharing options...
joe123 Posted July 11, 2007 Share Posted July 11, 2007 it should be 0 9 * * * /path/to/php -q /home/tbs/public_html/whmcs/admin/cron.php so if the path to your php is /usr/bin/php it should be 0 9 * * * /usr/bin/php -q /home/tbs/public_html/whmcs/admin/cron.php login to root and type : which php this will give you the correct path in your system 0 Quote Link to comment Share on other sites More sharing options...
trine Posted July 11, 2007 Share Posted July 11, 2007 on some systems, you may want to enclose the entire command in quotes. also, depending on your system, you may also want to ensure that the script is executable by the proper user and group. if you can, you can also add it via the crontab command, or if you are root, you can add it directly to your cron.d 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted July 12, 2007 WHMCS CEO Share Posted July 12, 2007 it should be 0 9 * * * /path/to/php -q /home/tbs/public_html/whmcs/admin/cron.php so if the path to your php is /usr/bin/php it should be 0 9 * * * /usr/bin/php -q /home/tbs/public_html/whmcs/admin/cron.php login to root and type : which php this will give you the correct path in your system You are incorrect - that's isn't necessary. The command given by WHMCS is the correct one and it should just be "php -q /home/tbs/public_html/whmcs/admin/cron.php". The issue is that a lot of users enter the numbers as part of the command also. Only the part in quotes above is the command, the numbers are for the time the cron should run. Matt 0 Quote Link to comment Share on other sites More sharing options...
joe123 Posted July 12, 2007 Share Posted July 12, 2007 maybe you are correct but my cron will always return an error without the path . well , he should try both commands. 0 Quote Link to comment Share on other sites More sharing options...
bear Posted July 12, 2007 Share Posted July 12, 2007 As Matt said, it's probably because they entered the numbers in the "command to run" field. /bin/sh: 0: command not found It can't run the "0" command and exits. The first thing in that cron entry probably begins with the "0", instead of "php". @tbsweb: Please take a screen capture of the cron editing window, showing the entry as you have it. That should clear up all doubt about how it's being entered. [EDIT] By the way, when you receive an email from the cron daemon, it contains the full "run" command in the subject, typically. This means, if you get an email that says "Cron: 0 9 *** php -q......", the numbers were included in the run line. 0 Quote Link to comment Share on other sites More sharing options...
tbsweb Posted July 13, 2007 Author Share Posted July 13, 2007 Yes I have entered the numbers in the command as I thought it put the time in for you also with the command have now removed and set time. Hope it works Thanks for help. 0 Quote Link to comment Share on other sites More sharing options...
bear Posted July 13, 2007 Share Posted July 13, 2007 No problem, please let us know how it turns out. 0 Quote Link to comment Share on other sites More sharing options...
tbsweb Posted July 13, 2007 Author Share Posted July 13, 2007 Sucess worked perfect: Cron Job Report for 13-07-2007 09:00:01 0 Invoices Created 0 Invoice Payment Reminders Sent 0 Subscription Payment Reminders Sent 0 Accounts Suspended 0 Tickets Automatically Closed Disk & Bandwidth Usage Statistics Updated Thanks guys So the morale is always put the time in yourself. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.