Trying to figure out how to run a php crontab.
Right now I am attempting to execute it every minute so that I can test to make sure I have the correct path, yet I am not getting an email telling me anything and it doesn't seem to be executing the script I want to run.
This is what I have in the webserver nfo control panel crontab:
MAILTO="myemailaddress"
1 * * * * php /home/[nfo username]/private/[what script I want to run.php]
I am sure I am jacking up the file path, but I am unsure how to test/fix it.
CRONTAB Help
-
- New to forums
- Posts: 3
- https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
- Joined: Wed May 18, 2016 6:55 pm
-
- This is my homepage
- Posts: 97
- Joined: Wed Dec 02, 2015 10:56 pm
Re: CRONTAB Help
The path of the php binary has to be added.
1 * * * * /usr/bin/php /home/[nfo username]/private/[what script I want to run.php]
Make sure the crontab file ends with an empty line.
1 * * * * /usr/bin/php /home/[nfo username]/private/[what script I want to run.php]
Make sure the crontab file ends with an empty line.
Re: CRONTAB Help
If you want it to run every minute, you have to put * for the minutes field. If you put a 1, it will only run at minute 1 of each hour (an hour starts at minute 0 and goes through minute 59).
* * * * * yourcommand
You should also use the full path to the php executable, as It'sRandinator suggested.
* * * * * yourcommand
You should also use the full path to the php executable, as It'sRandinator suggested.
Re: CRONTAB Help
is the file path of /home/[nfo username]/private/[executable.php] correct?
Just trying to make sure it will be able to find the php file.
It is telling me:
Could not open input file:
Just trying to make sure it will be able to find the php file.
It is telling me:
Could not open input file:
Re: CRONTAB Help
Disregard all, figured it out! Sorry never used putty before but that helped me figure out the file path.
Thank you both for all the help!
Thank you both for all the help!
Re: CRONTAB Help
I'm sorry, I should have noticed that -- the path should normally start with /usr/www/yourusername.