This little script automates the dump of your DAViCal database :
#!/bin/sh
PATH=/bin:/usr/bin
export PATHbackup_location=/data/backups/davical
now=`date “+%Y.%m.%d_%H.%M.%S”`
backup_file=$backup_location/davical_$now.pgdumpsu – 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 davical
pg_restore -Fc -d davical davical.pgdump
Trackbacks & Pingbacks 1
[...] recently published a server-side script to backup all calendars stored in a Davical server. On request and idea of [...]
Post a Comment