I want to to run php page which is in root folder /var/www/ in a particular time daily. My www director is 755 permission.
I am doing cron job in /etc/crontab as an admin for mysqldump. Its working fine there. But this time I want to run particular page in /etc/crontab. And I failed to make it work after spending lots of time research.
Following is what I did in /etc/crontab.
14 36 * * * root /usr/bin/php /var/www/mysite/page.php
What I want is, At 14:36HOURS, I want /etc/crontab to run page /var/www/mysite/page.php. And do necessary things i.e updating in mySQL database.
Try
36 14 * * * /usr/bin/php /var/www/mysite/page.php
The format for crontab is minutes, hours, Day of month, month, Day of week
If you want to run your cron as root, use sudo when editing cron
sudo crontab -e
Execute the script using php from the crontab
36 14 * * * * root /usr/bin/php /var/www/mysite/page.php
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR`
sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
for more information http://www.thegeekstuff.com/2009/06/15-practical-crontab-examples/