scheduled tasks on osx

Soldato
Joined
1 Feb 2006
Posts
8,188
hi, i am developing content management system for part of a uni project and I have a database update script (php) which I want to run every 15mins. How would I go about setting up a scheduled task to do this on osx? If it was live I think its called a cron task but not sure how to simulate this when testing locally. Thanks in advance.
 
ok cool, will check that out. Know nothing about cron but will give it a go. Its not important really but if i can get it working it will be a bonus.
 
In terminal type crontab -e, then enter */15 * * * * /usr/bin/php /path/to/your/php/script.php

the editor is vim by default so press i to get to insert mode before typing the line and after you've typed it press esc then :wq to save and quit, after that your script should automagically be run ever 15 minutes.
 
I don't like :exi (or :x) because I'd rather know for sure that a file has been written or explicitly say do not write. That's kind of important when editing system critical stuff. :)
 
Back
Top Bottom