I am trying to run a crontab on Ubuntu, I think I get the general idea of how to create a crontab
I did the following…
1) run command crontab -e
2) add entry 04 22 * * * /var/www/update_ranks >> /root/update_ranks.root.txt
3) check a text file was created under root/ named update_ranks.root.txt at the specified
time.
The file update_ranks.root.txt is empty and the php file is not executed, what am I doing wrong?
If
update_ranksis a bash file try adding sh before the scriptsh /var/www/update_ranksBy the way, check if you are doing that as root user or user with writing rights to
/root. Trysudo crontab -e.EDIT:
If it’s a PHP file, you need to execute it in php
/usr/bin/php /var/www/update_ranksand if the file has extension, use this:/usr/bin/php /var/www/update_ranks.php