InfiniteWP is a great tool for managing multiple WordPress sites. I won’t go into explaining all that it can do, but it has a lot of great features, and one feature allows you to run automatic backups of all your WordPress sites (if you buy the addon). But in order to do this you need to add a cron job to your server. Here’s what the settings panel shows:
The problem I ran into is that cron job won’t work if you’re using MAMP because it runs its own version of PHP. A great solution is listed on the InfiniteWP Support Forum. One thing I like is it uses CURL instead of PHP. Here are the steps: (replace localhost with the URL of your local copy of IWP)
- In Terminal type crontab -e. This allows you to add a cron job, using the vim editor.
- Press i on your keyboard to go into vim’s insert mode.
- Type in your cron command. For example, to run at minute 5 of every hour using curl, use:
5 * * * * /usr/bin/curl –silent –compressed http://localhost:8888/cron.php
- But to run every 5 minutes, use:
*/5 * * * * /usr/bin/curl –silent –compressed http://localhost:8888/cron.php
- Note that if you are not using MAMP’s default 8888 port, you should leave that off.
- While in insert mode you can use the arrows and delete keys as you would normally.
- Press escape key to exit vim’s insert mode.
- Type ZZ (Must be capital letters — saves the file and exits crontab). Or you can type :wq (stands for write and quit).
- Verify the cron job details by typing crontab -l (that’s a lower case L) at the terminal prompt.
We recommend that you first try setting the job to run every 2 minutes (with */2), so that you can check, reasonably quickly, that it is running.
Then edit crontab again and change the curl command to your preferred time, either */20 or */5
To learn more about how cron works: http://en.wikipedia.org/wiki/Cron