Results 1 to 5 of 5
Hello,
I've been trying to setup a cron job without any success. I've read quite alot of articles about cron jobs and i've tried so many different variants but nothing ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-26-2008 #1Just Joined!
- Join Date
- Jun 2008
- Posts
- 13
Setting up a cron job?
Hello,
I've been trying to setup a cron job without any success. I've read quite alot of articles about cron jobs and i've tried so many different variants but nothing seems to work.
Here's the current cron job i've setup:
30 * * * * /usr/bin/php -q /home/a/c/acornmedia/public_html/cron.php > /dev/null
i know the first part is the time i want it to run, (every 30 minutes)
the second part specifies the location of php? (this is where my host told me.)
-q ?? i've no real idea what this does.
this is the path to my live website files.
> ?? not really sure
/dev/null ignores display warnings?
Can anyone spot what i've done wrong?
the cron.php file only has this wrote in:
<?php
mail('example@example.com', 'test message', 'test message');
?>
(i've removed the real address.)
Thanks
- 06-26-2008 #2
if you just run this command
does it do what you want?Code:/usr/bin/php -q /home/a/c/acornmedia/public_html/cron.php > /dev/null
- 06-26-2008 #3Just Joined!
- Join Date
- Jun 2008
- Posts
- 13
No, it doesn't seem to do anything.
What permissions do i need to give the cron.php? it currently has 755
- 06-27-2008 #4
sorry, what if you run it without the > /dev/null at the end?
how about something like this as a command:
or does it have to be the cron.php file?Code:echo -e "Subject:Status Update\nFrom:SenderAddress <user@domain.com>\n"`cat attachment.txt` | sendmail user@domain.com
- 06-27-2008 #5Just Joined!
- Join Date
- Jun 2008
- Posts
- 13
Well the cron.php file im trying to run is actually just a test file.
I've got a few more complicated php files that i need to run to do hourly/daily tasks on our website.
So i'm just using a very simple php file so i know that the file works, and there shouldn't be any problems with the actual php file.
I've browsed to /usr/bin/ and php is there.
And /home/a/c/acornmedia/public_html/ is the correct path to the web directory, as i've got a php script that uses this path to create backups to the web directory. (and i can browse to the file i want via cd /home/a/c/... etc/cron.php)


Reply With Quote
