About a year ago something happened on Google’s end that caused one of my calendar’s information to be lost. Fortunately I had a backup that had a majority of the information in it, but it got me thinking about backing up my Calendar to ensure that if, worst case scenario, I lost a calendar I wouldn’t be SOL. Here is how I routinely backup my google calendar thanks to an easy to use bash script. Note these instructions assume you are running from linux.
- First thing to do is to get the Private iCal link for your Google calendar. I specify private as in most cases the Google Calendar is a private calendar
- Once you have that then you can add it to the bashscript below, replacing the bolded calendar url with the private iCal url that you have
!/bin/bash
wget http://www.google.com/calendar/sample_ical/calendar
Copy the above script and save it in a file called googlecal.sh. Next configure a cron job to run the script routinely. Here is my sample cron command:
# m h dom mon dow command
30 9 * * * sh /root/googlecal.sh

