hamza Posted June 11, 2008 Share Posted June 11, 2008 i am new in php i need to execute or use the cron tab what should i do if i need to execute one file at a particular date of every week. thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/109720-crontab-help-me/ Share on other sites More sharing options...
Vizor Posted June 11, 2008 Share Posted June 11, 2008 Crontab has the format m h dom mon dow command so if you wanted a script to execute every tuesday you would put in your crontab * * * * 2 /home/bin/script.php I'm sure you could work the rest out for yourself. Quote Link to comment https://forums.phpfreaks.com/topic/109720-crontab-help-me/#findComment-563007 Share on other sites More sharing options...
DarkWater Posted June 11, 2008 Share Posted June 11, 2008 @Vizor: You're half-right. He'd actually need something like: * * * * 2 /usr/bin/php /home/bin/script.php It needs to be run through the PHP parser. Quote Link to comment https://forums.phpfreaks.com/topic/109720-crontab-help-me/#findComment-563024 Share on other sites More sharing options...
Vizor Posted June 11, 2008 Share Posted June 11, 2008 @DarkWater: So are you. It depends whether or not you add #! /usr/bin/php to the start of your script and then chmod +x it; if you do that then you don't need to specify that it's to be run through the php parser. Quote Link to comment https://forums.phpfreaks.com/topic/109720-crontab-help-me/#findComment-563033 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.