View Full Version : Cron Job
Novus Mortuus
05-20-2008, 04:10 PM
I;m not sure if you'll be able to help me or not, as it could be a problem with the path on the server but no-one's answering me on the host forum, so:
Having trouble setting up my first cron job.
* * * * * /public_html/aa/pieces/cron.php
Gives me:
/bin/sh: /public_html/aa/pieces/cron.php: No such file or directory
Same with:
* * * * * /www/aa/pieces/cron.php
When i go to the file and just copy paste the path..
* * * * * /home2/***/www/aa/pieces/cron.php
It gives me:
/bin/sh: /home2/***/www/aa/pieces/cron.php: Permission denied
What's the issue? As far as i can see that's the right path..:(:confused:
Novus Mortuus
05-20-2008, 06:28 PM
Never mind, i got it working with:
/usr/bin/php -a /home2/***/www/aa/pieces/cron.php
Novus Mortuus
09-13-2008, 04:55 PM
Another Cron Job problem..
I have a file that i want to run every 2 hours, now this is what i have in the cron job section (With some bits ***'d out):
0 */2 * * * /usr/bin/php -a /home2/***/includes/***_cron.php
I have tried including that file and running it in the browser and it works fine. And i have other cron jobs set up in an identical way that work, but for some reason this one just isn't doing anything. It's not even sending me the email with a success/error message. Just nothing at all..
I'd show you the contents, but it's not important since it works fine when i run it in the browser, but briefly:
- I have another file included in it which connects to the db
- Some data is extracted and added up
- New data is then inserted into another field
- New data is exracted and written to a text file, which is then included on another page.
So basically, that page with the text file included should then update every 2 hours.
Is there any chance anyone can see anything wrong with the unix path..Or know why it might not be working?
Thanks.
AFAIK -a is the wrong option to use here.
http://articles.techrepublic.com.com/5100-10878_11-5889263.html
-f is what your looking for.
bradoeoe
10-05-2008, 03:02 AM
i havent set up any cron jobs yet does anyone have any examples for me to use?
bradoeoe do you have access to shell?
bradoeoe
10-05-2008, 04:54 PM
yup i no how to set them up asked my friends dad so dont worry i got it
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.