Posts Tagged ‘web’

How to configure a cron job on OSX

In the midst of trying to create a small Twitter-based website (stay tuned!), I realised it would be advantageous to have a cron job running on my local machine. This process would run every couple of minutes and pull my latest tweets into a database.
To achieve this, open your Terminal, and type crontab -e. If you’ve previously added jobs to your cron file, you will see them listed, otherwise this file will be blank. Hit i to begin editing the file. For my requirements, I wanted to run my file every two minutes: */2 * * * * /usr/bin/curl --silent --compressed http://localhost:8888/get-my-tweets.php Change that number to alter the interval at which the job is run, and feel free to ditch the very first asterisk if you’d prefer the job to run at x minutes past the hour, rather than every x minutes. To stop editing, save and exit the process, hit Esc, ZZ.