Jump to content

Cron JOB


tbsweb

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • WHMCS CEO
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

Link to comment
Share on other sites

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. ;)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated