(I've omitted my personal stuff)
#! /bin/bash
BACKUP_DIR="/path/to/your/backup/dir"
BASE_URL="http://www.google.com/calendar/ical/"
FILENAMES=(gHome gWork)
KEYS=(restof/url/to/your/cal/basic.ics restof/url/to/your/other/cal/
basic.ics)
if ((${#FILENAMES[@]} != ${#KEYS[@]}))
then
echo "Not equivalent amount of keys as desination files... Exiting"
exit 1
fi
SUFFIX=".ics"
DATESTR=`date "+%C%y%m%d%H%M%S"`
cd $BACKUP_DIR
for ((I = 0; I < ${#FILENAMES[@]}; I++))
do
FILE="${FILENAMES[$I]}-$DATESTR$SUFFIX"
URL="$BASE_URL${KEYS[$I]}"
curl -s $URL > $FILE
done
This creates two files in the specified directory: gHome-20070801133717.ics and gWork-20070801133717.ics