Setting up a cron job?
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:
mail('email@example.com', 'test message', 'test message');
(i've removed the real address.)
if you just run this command
does it do what you want?
/usr/bin/php -q /home/a/c/acornmedia/public_html/cron.php > /dev/null
No, it doesn't seem to do anything.
What permissions do i need to give the cron.php? it currently has 755
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?
echo -e "Subject:Status Update\nFrom:SenderAddress <firstname.lastname@example.org>\n"`cat attachment.txt` | sendmail email@example.com
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)