Harpo Jaeger dot com

Wget

Wget is an awesome command line utility for file transfers. I just wrote a script that will check every day at midnight to see if any files have been changed on my website, and if they have, download them and write the progress to a log file. It will not redownload the entire site every time, which would take forever and be a complete waste of disk space. Wget has tons of options, and can be made to do almost anything.

Since this site is run by WordPress, the data for posts and pages is stored in a MySQL database. This is already backed up automatically once every hour to an email account I created expressly for this purpose. The command line script I wrote checks the folder where uploaded files, plugins, themes, and the PHP code I’ve written to power, for instance, the Exquisite Corpse page, live, so that I will always have a current copy of those files. I like to keep older copies of my database for the purpose of history and extra security, but one copy of these particular files is enough. Plus, Time Machine running on my Mac will keep historical copies of the backup folder on my hard drive, so I will end up with a similar result.

I will check the log file tomorrow morning to see if the script ran properly. Hopefully it will have worked and will henceforth take care of itself in the background without my ever having to pay attention to it again.