InMotion Hosting Support Center

Cron job is not running

Category: Cpanel

2013-10-31 7:58 am EST

Hits: 4,811
I've tried just about everything to get my cron script to work but am not having any luck. I've been through your mini tutorial several times too! Here's what I'm trying to run... /home/MYUSERNAMER/public_html/DOMAIN/cartbookopencartsync/cronjob/ and I've also tried setting it up so that it points directly to the php that the above script attempts to trigger by using your tutorial. Nothing I try works. Can you help? Someone recommend this?... wget -q -O /dev/null - Will that work? Thanks inmotion!

You must login before you can ask a follow up question.

You must login before you can submit an answer.

& by "DOMAIN" - I mean the folder name. - Thanks!
22 Points
2013-10-31 07:59 am EST



5,399 Points
2013-10-31 9:11 am EST
Hi macmike78,

Sorry to hear our <a href='/support/edu/cpanel/301-run-cron-job'>cron setup</a> article didn't help. The first thing I would review is whether the cron is running or not. If it is not running, that's one thing. If it is running however, the script you're executing may not be doing what you want it to do.

<h2>Cron Email Alerts</h2>
I suggest setting up your cron job to send you an email when it runs. In this way, you can tell if the cron job is at least executing. You can find more information about setting up an automated email when your cron runs here:

<a href='/support/website/cron-jobs/cron-job-email'>Why is my cron job not emailing me?</a>

Let us know what results you get and we'll start troubleshooting again from there with you.

- Brad

You must login before you can post a comment about this answer.

I did that several times too (sorry, should have mentioned). It always came back like this... /home/USER/public_html/DIRECTORY/cartbookopencartsync/cronjob/ line 4: cd: /var/www/html/DIRECTORY/cartbookopencartsync/opencart/accounting: No such file or directory

I've tried tweaking the path several times and even when I send it directly to the php file that the .sh command points to - it still says no file even though it's there.
22 Points
2013-10-31 9:17 am EST
OK, so it sounds like the script is saying, "file does not exist" when clearly it does?

Can you give us the line of code that is calling the file? I'm curious to see. I'm not sure why it's calling <span style='color:orange;'>/var/www/html</span> if you explicitly set it to <span style='color:orange;'>/home/USER/...</span>

We want to make sure that your path is beginning with a forward slash, that it's an absolute path.
5,399 Points
2013-10-31 9:52 am EST
umask 002

cd /var/www/html/cartbookopencartsync/opencart/accounting

/usr/bin/php -q sync-opencart-fa.php

Thanks Brad!
22 Points
2013-10-31 10:03 am EST
I'm not sure how you have your account setup, but is there a reason you're using this?

<span style='color:orange;'>cd /var/www/html/cartbookopencartsync/opencart/accounting</span>

Have you tried this?

<span style='color:orange;'>cd /home/USER/public_html/cartbookopencartsync/opencart/accounting</span>
5,399 Points
2013-10-31 10:07 am EST
Got it! Went to use the WGET method I sent earlier but switched to your Curl fix & it worked like a charm! Thanks!!
22 Points
2013-10-31 12:02 pm EST
Hi macmike78, glad to hear you got it fixed! Was it just a <span style='color:orange'>wget / curl issue</span>, or did you have to update the path or do anything else?
5,399 Points
2013-10-31 1:31 pm EST
nope - that was is. guess I didn't thoroughly understand in the beginning about going that route. All is well. It was just wget/curl. Thanks!
22 Points
2013-10-31 5:06 pm EST
Like this Question?

Forum Login

You are NOT logged in. You can still browse our Support Center.

To participate within our Community Support Forum:

Need more Help?

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!