Automatic WordPress Updates with SVN

Want to keep your WordPress install up to date automatically? Follow these steps to add a cron job to update your WordPress install every 6 hours.

Set up the install

The WordPress install must be a Subversion checkout. You can grab the bleeding edge source with a command like this:

svn co http://core.svn.wordpress.org/trunk/ .

If you aren’t familiar with Subversion, start here:

Schedule the updates

Add the cron job from the command line.

  1. Edit the cron job list.
    crontab -e
  2. Add the cron job (edit the path to your WordPress install).
    MAILTO=""
    # Update WordPress install every six hours
    * */6 * * * svn up -q ~/path/to/your/wp-install
  3. Save and close.

To learn more about editing cron jobs from the command line search Google for man cron and man crontab.

You can also use a GUI tool like CronniX on Mac OS X to manage the cron jobs.

Notes

  • The -q parameter tells the svn update command to run silently so that you don’t have to worry about any output from the cron job. But, you should add the MAILTO definition if you want to completely silence output.
  • Some systems don’t recognize the */6 syntax for hourly notation. If you get an error when trying to save the cron job you might have to change it to comma-separated values instead: 0,6,12 or similar.