I recently published a server-side script to backup all calendars stored in a Davical server. On request and idea of Bruno Friedmann, here is a script to save your own calendars from the client. It’s not very elegant (eg it doesn’t discover your calendars but need a static list) but basically works.
# save ICS calendars from CALDAV server
# Ch. Bueche, 4.2.2010
# connection info
# list of server-side calendars to backup
# get these names by looking at “get info” in iCal
CALENDARS=”Priv Work 63B209D5-524F-440F-B492-5B028E6C0298″
if [ ! -d $BACKUP_DIR ]; then
for cal in $CALENDARS
echo “getting calendar $cal”
curl -s -k -X GET -u $USER:$PASSWORD -o “$BACKUP_DIR/$cal.ics” “$SERVER_URL/$USER/$cal”
echo “all done”
Feel free to find out how to get a list of calendars using some smart curl command and CALDAV enumeration.