====== Vdirsyncer ====== [[Vdirsyncer]] permet de synchroniser des calendriers (CalDav) et des contacts (CardDav) depuis le terminal. Il est à utiliser avec, par exemple, [[khal]] et [[khard]]. ===== Installation ===== Sur [[ubuntu]], il est dans le dépôts : $ sudo apt install vdirsyncer ===== Configuration ===== La configuration se place dans ''~/.config/vdirsyncer/config''. $ cat ~/.config/vdirsyncer/config [general] # A folder where vdirsyncer can store some metadata about each pair. status_path = "~/.vdirsyncer/status/" ############################################################################### # CARDDAV # Synchronize all collections that can be found. # You need to run `vdirsyncer discover` if new calendars/addressbooks are added # on the server. [pair my_contacts] a = "simon_contacts_local" b = "simon_contacts_remote" collections = ["from a", "from b"] # Synchronize the "display name" property into a local file (~/.contacts/displayname). #metadata = ["displayname"] # To resolve a conflict the following values are possible: # `null` - abort when collisions occur (default) # `"a wins"` - assume a's items to be more up-to-date # `"b wins"` - assume b's items to be more up-to-date #conflict_resolution = null [storage simon_contacts_local] type = "filesystem" path = "~/.contacts/" fileext = ".vcf" [storage simon_contacts_remote] type = "carddav" url = "https://mon.nextcloud.be/remote.php/dav/addressbooks/users/simon/contacts/" username = "simon" # The password can also be fetched from the system password storage, netrc or a # custom command. See http://vdirsyncer.pimutils.org/en/stable/keyring.html password = "mongrospassword" # password.fetch = ["prompt", "Password for CarDAV"] ############################################################################### # CALDAV [pair _calendar] a = "simon_calendar_local" b = "simon_calendar_remote" collections = ["from a", "from b"] # Calendars also have a color property metadata = ["displayname", "color"] [storage simon_calendar_local] type = "filesystem" path = "~/.calendars/" fileext = ".ics" [storage simon_calendar_remote] type = "caldav" url = "https://mon.nextcloud.be/remote.php/dav" username = "simon" password = "mongrospassword" # password.fetch = ["prompt", "Password for CalDAV"] ==== Découverte des différents calendriers ==== $ vdirsyncer discover Discovering collections for pair my_contacts simon_contacts_local: - "contacts" simon_contacts_remote: - "contacts" ("Contacts") Saved for my_contacts: collections = ["contacts"] Discovering collections for pair _calendar simon_calendar_local: simon_calendar_remote: - "monCalendrier" ("mon Calendrier") - "monAutreCalendrier" ("mon Autre Calendrier") - (...) warning: No collection "monCalendrier" found for storage simon_calendar_local. Should vdirsyncer attempt to create it? [y/N]: y warning: No collection "monAutreCalendrier" found for storage simon_calendar_local. Should vdirsyncer attempt to create it? [y/N]: y (...) Saved for _calendar: collections = ["monCalendrier", "monAutreCalendrier", (...)] ==== Synchronisation des métadonnées ==== $ vdirsyncer metasync Metasyncing my_contacts/contacts Metasyncing _calendar/monCalendrier Metasyncing _calendar/monAutreCalendrier (...) Copying displayname to simon_calendar_local/monCalendrier Copying displayname to simon_calendar_local/monAutreCalendrier (...) Copying color to simon_calendar_local/monCalendrier Copying color to simon_calendar_local/monAutreCalendrier (...) ==== Synchronisation des données/calendriers ==== $ vdirsyncer sync Syncing my_contacts/contacts Syncing _calendar/monCalendrier Syncing _calendar/monAutreCalendrier (...) Copying (uploading) item 055b40e6-b1ba-4940-96de-cdd4345be39a to simon_calendar_local/monCalendrier (...) ===== Problèmes rencontrés ===== J'ai du supprimer les calendriers locaux ( work, personal) qui avait été créés automatiquement par [[khal]] pour ne pas qu'il essaye de les créer sur mon [[nextcloud]]. [[khal]] a un problème avec les noms de calendrier (displayName) qui ont une apostrophe, j'ai du changer manuellement le nom d'un de mes calendrier. $ vim ~/.calendars/monCalendrier/displayname