We are starting to use Google Docs quite a bit more at work and unsurprisingly the question of backup and offline availability comes into play. As part of the backup strategy we also wanted to capture incremental versions of the documents (on a daily basis) in the event we needed to go back to the prior versions.
To this affect I whipped up a small (120 lines) PHP script that will retrieve all your Google documents and save them to a local directory, in the event the document was created/updated in the last 24 hours, thus ensuring snapshot support. Each file name is prefixed with Ymd (Year,month,day) prefix to ensure name uniqueness and provides an easy way to spot similar files or files that were created/updated on the same day. The script has just two dependancies, cURL and Simplexml extensions, which most PHP 5.0+ installs should have.
I am publish the script for anyone with similar needs to use/improve under the BSD license...
Enjoy.
Update
I've made a few improvements to the script, some of which have been suggested by Philip (thanks), and since this looks to be an envolving project I've put it into GitHub.
Git Repository:
http://github.com/iliaal/Google-Docs-Backup
Here are the list of changes:
Continue reading "Google Docs Backup Script"