Vdirsyncer

From wikinotes

vdirsyncer synchronizes caldav/carddav to your computer (so it is available offline).

Documentation

documentation https://vdirsyncer.pimutils.org/en/stable/
github https://github.com/pimutils/vdirsyncer

Locations

~/vdirsyncer/config config file
~/.vdirsyncer status
~/.contacts/ (pers) contacts
~/.calendars/ (pers) calendars

Install

Linux

pacman -S vdirsyncer

You can then use cron, or systemd to synchronize contacts.

# crontab
*/5 * * * * /usr/bin/vdirsyncer sync
# systemd service
# (sync within 5min of boot, then every 15min)
systemctl --user enable vdirsyncer.timer

Usage

vdirsyncer discover  # find new contacts/calendars
vdirsyncer sync      # sync all contact/calendars

# debugging
vdirsyncer -vdebug discover  # pay attention to header messages

# delete all, resync
rm -rf .vdirsyncer
rm -rf .contacts
rm -rf .calendars

Configuration

NOTE:

Several account types are available, google requires token auth.

Basics

[general]
status_path = ~/.vdirsyncer/status/
# Pairs are used to establish connections between two
# 'storage' locations
 
[pair morpheus_cal]
a = morpheus_cal_local
b = morpheus_cal_remote
collections = ["from a", "from b"]		    # vdirsyncer syncs all calendars in both 'a', and 'b'
conflict_resolution = ["command", "vimdiff"]  # manually resolve conflicts (alternatively, can choose a src)
# 'storage' locations are sources for the calendar.
# These can be .ics files, caldav locations, etc.

[storage morpheus_cal_local]
type    = filesystem
path    = ~/.contacts/
fileext = .ics

[storage morpheus_cal_remote]
type     = caldav
url      = http://morpheus/cal.php
username = will
password.fetch = ['command', '~/.get_pass.sh']

Advanced

Baikal allows additional settings, notably for auth if you have chosen an authorization scheme other than Basic.

[storage morpheus_cal_remote]
auth = "digest"


See Documentation for details:

caldav options https://vdirsyncer.pimutils.org/en/stable/config.html?highlight=digest#storage-caldav
carddav options https://vdirsyncer.pimutils.org/en/stable/config.html?highlight=digest#storage-carddav