-
Notifications
You must be signed in to change notification settings - Fork 0
/
backup_google.sh
24 lines (20 loc) · 991 Bytes
/
backup_google.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /bin/bash
## This script backs up my calendars -- will use with Cron to backup daily.
## following is adapted from http://permanentinkdesign.com/articles/backing-up-a-google-calendar/
INCREMENT=`date +%Y%m%d%H%M`
DIR="$HOME/Documents/Backup_Google"
USERNAME="[email protected]"
PASSWORD="mypassword"
## Vinh's calendar
curl -s url-to-private-ics -o "$DIR/Vinh_$INCREMENT.ics"
## TNTTSP's calendar'
curl -s url-to-private-ics -o "$DIR/TNTTSP_$INCREMENT.ics"
## Birthdays
curl -s url-to-private-ics -o "$DIR/Birthdays_$INCREMENT.ics"
## Now backup Google Contacts
## http://www.joet3ch.com/2008/09/25/backup-google-contacts/
$HOME/Documents/bin/Backup_Google_Contacts.py > ${DIR}/VinhContacts_$INCREMENT.xml
## Now backup Google Reader subscriptions
## http://www.clausconrad.com/blog/backup-google-reader-subscription-list-to-opml-automatically
$HOME/Documents/bin/gr-opml-backup.py $USERNAME $PASSWORD > Vinh_GoogleReaderSubs_$INCREMENT.opml
find $DIR -mtime +14 -exec rm -f {} \;