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/batch-opencart-fa.sh 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 http://www.yourdomain.com/cartbookopencartsync/opencart/accounting/sync-opencart-fa.php - Will that work? Thanks inmotion!
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.
I did that several times too (sorry, should have mentioned). It always came back like this... /home/USER/public_html/DIRECTORY/cartbookopencartsync/cronjob/batch-opencart-fa.sh: 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.
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.