client-side backup of CALDAV calendars

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.

#!/bin/sh
#
# save ICS calendars from CALDAV server
# Ch. Bueche, 4.2.2010
#

# connection info
USER=myself
PASSWORD=mysecret
SERVER_URL=https://my.caldav.com/caldav.php/

# 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″

TODAY=`date “+%Y.%m.%d”`
BACKUP_DIR=”/data/backup/calendars_$TODAY”
if [ ! -d $BACKUP_DIR ]; then
mkdir $BACKUP_DIR
fi

for cal in $CALENDARS
do
echo “getting calendar $cal”
curl -s -k -X GET -u $USER:$PASSWORD -o “$BACKUP_DIR/$cal.ics” “$SERVER_URL/$USER/$cal”
done

echo “all done”

Feel free to find out how to get a list of calendars using some smart curl command and CALDAV enumeration.

a test from my iPhone

Blogpress is an iPhone app to post blog entries. With BTstack, a Bluetooth keyboard and a jailbroken iPhone, it’s quite usable for posting on the go.

1195 days uptime. Try this with Window$

I’m sure someone will complain about the non-patched status of this server and tell me I’m a loosy admin.

expensive thermometer

I had to certify a new device category on a customer NMS, naming a Cisco 2911. To check whether Cisco did a good job with their MIB, I had to cool it down, which was easy, as we have winter right now.

Success, zone-IntakeLeft went down to 10°. I had to close the windows to avoid getting sick, but it would be interesting to try -5° to check the MIB behaviour.

Welcome SUI 223, long live SUI 192

Yeah, I got my new sail number yesterday, it will be SUI 223. Good luck to the new owner of SUI 192, my dear ДАВАЙ-ДАВАЙ.

DAViCal automated backup

This little script automates the dump of your DAViCal database :

#!/bin/sh

PATH=/bin:/usr/bin
export PATH

backup_location=/data/backups/davical

now=`date “+%Y.%m.%d_%H.%M.%S”`
backup_file=$backup_location/davical_$now.pgdump

su – postgres -c “pg_dump -Fc davical > $backup_file”
gzip $backup_file

# remove old backups
find $backup_location -type f -name “davical_*.pgdump.gz” -mtime +30 -exec rm {} \;

exit 0

Install it as /etc/cron.daily/davical_backup on your Linux box.

To restore your database after a disaster, use this :

createdb –owner davical_dba –encoding UTF8 –template template0
pg_restore -Fc -d davical davical.pgdump

davical rocks

shared calendars in iCalDAViCal is an implementation of the CALDAV standard. It’s open source, developed by Andrew McMillan, and quite simple to install if you know a few bits of Apache configuration. I got it working with two iCal instances and 2 iPhones (wife and me), with a few shared calendars for family and kids stuff.

In version 0.9.8, Andrew has re-implemented a new user and role system making administration simpler. If you look for a way to delete a calendar, don’t search in the web GUI, it’s not there yet. But curl does the job well : Continue Reading »

ils en ont une grosse paire, ceux-là

Pour éviter que tous les couillons de la planète continuent de massacrer les baleines et les requins qui restent, Sea Shepherd a besoin de votre contribution.

Bonnes résolutions pour 2010

  • Moins travailler
  • Plus naviguer
  • Réussir mon permis de navigation en mer

Another normal day at work

Two CCIE’s trying to solve a multicast issue, half an hour before getting drunk during the X-mas party.
ccies_at_work