This Magento Extension offers customizable templates for PDF invoices, shipments and creditmemos that can be send via email to your customers.learn more
Backup your CalDav calendar with a Raspberry Pi
One of the basic things that you as a developer must know is how to handle a version control system like git, subversion, Mercurial, you name it..
Once that you have grasped all the benefits of such a version control system, you won’t ever miss that. But you begin to recognize to miss it in a lot of other applications where you want to e.g. track the history.
One of those applications for me is my calendar. Especially if you share your calendar with other people (perhaps not with IT background) a lot of things begin to happen, like missing appointments, moving appointments around, timezone issue and so on.
So one of the basic requirements for me was to backup the CalDav calendar regularly. Unfortunately most of the email providers that offer calendar functionality do not offer such a service that’s why I implemented it myself with the help of a Raspberry Pi 3B.
The script uses the open source software cadaver and should work with CalDAV calendars in general, in my case I use it with calendars from 1&1 email.
All you have to do is install the cadaver client according to the documentation and create a new script e.g.
backup-caldav.sh with the following content:
# @see https://uriesk.wordpress.com/2015/02/13/backup-your-caldav-calendar-with-cadaver/
mkdir -p /tmp/calendar
cadaver "$CALDAV_URL" << EOA
# check if any files were downloaded
compgen -G "*.ics" > /dev/null || exit 1
tar cvfj "$FILENAME" calendar
rm -r /tmp/calendar
echo "Backup file $FILENAME successfully completed on `date`."
Then execute the script via e.g. crontab on your Raspberry Pi (or of course any other linux system in your network) with the following command:
./backup-caldav.sh https://your.caldav.url user password
After running this script the resulting backup file will be saved to