pimsync.1ΒΆ
pimsync(1) | General Commands Manual | pimsync(1) |
NAME
pimsync - synchronise caldav, carddav, webcal and local directories
SYNOPSIS
pimsync [-c configfile] [-v loglevel] command
DESCRIPTION
pimsync synchronizes calendars and contacts. For calendars, it supports operating on a local directories, CalDAV servers or Webcal URLs. For contacts, it supports operating on local directories or CardDav servers.
The following glossary provides a brief overview of relevant terminology:
item
collection
storage
pair
conflict
OPTIONS
-c configfile
-v loglevel
COMMANDS
check [pair…]
daemon [pair…]
Once it has reached its ready state, the demon will monitor storages for changes and synchronise them. In case of non-fatal errors, pimsync will continue running the background and try again later.
Individual items that fail to sync will be skipped.
discover [pair…]
resolve-conflicts [pair…]
Execute an external program, specified in the configuration file, which performs conflict resolution program for each conflicting item.
Appending -n performs a dry run and won't perform any write operations.
sync [pair…]
repair [storage…]
version
If a pair is specified, only operate on pair(s) with the given name(s).
FILES
If $XDG_CONFIG_HOME is defined, the configuration shall be read from:
If the above is not defined, the configuration file shall be read from:
See pimsync.conf(5) for details on the configuration file format.
ENVIRONMENT
XDG_CONFIG_HOME
READINESS NOTIFICATION
Readiness notification allows a service manager to monitor when pimsync has successfully started. It is considered to have successfully started when the configuration file has been parsed and all credentials have been resolved. At this point, no further human interaction shall be required.
Once the service is ready, it will write READY=1 followed by a newline character to the file descriptor READY_FD, and then close it. This is compatible with the readiness notification mechanism implemented by s6, dinit and systemd.
PRIVACY
The only network communications shall be with the servers for configured storages, and the locally configured DNS resolver.
The status database file contains metadata of configured storages, their collections and items.
DATA VALIDATION
Data synchronised is not validated. This is an intentional design choice: if your calendar application produces events that are technically invalid, pimsync will synchronise, and you will be able to access the exact same data on other hosts. You may also need to synchronise invalid data in order to fix the invalidity.
In order to map items between storage, pimsync does some minor parsing of items to extract their UID. Items must be syntactically valid components, even if semantically invalid.
In order to interact with CalDAV/CardDAV resources where a UID cannot be extracted, use the repair command to fix invalid entries, or consider using davcli(1).
SECURITY CONSIDERATIONS
When service discovery is enabled, the real hostname and port of the DAV server is resolved using DNS records. The system's DNS resolver is used. It is expected that the system resolver performs DNSSEC validation and will not return invalid results. Pimsync does not perform DNSSEC validation itself.
Pimsync will follow symlinks when reading items. Care should be taken when a user has write permission to a storage, but another user runs pimsync on that same storage. This may change at a future date.
Items across storages are considered the same if they share the same UID. An actor who can write a single item into a storage on either side can potentially trigger an overwrite of another item on the other storage. An actor who can write to a single entry should be considered to have access to manipulate the entire storage.
Pimsync will retain credentials in memory during its entire lifetime. Any actor with read access to pimsync's memory space may extract secret credentials from it. Likewise, core dumps from pimsync should not be shared with untrusted parties.
When logging with -v trace, logs MAY contain credentials, secrets, data inside of storage items and other sensitive information.
SYNCHRONISATION ALGORITHM
After pimsync synchronises two storages, it will store metadata from the items that it has synchronised into its internal status database. During future synchronisation processes, if the items on both storages don't match, the status database is used to determine which side has changed and which side remains the same as last time. This information is then used to plan which of the item should be kept and which one should be overwritten. If both items have changed, they are said to be in conflict, and the conflict must be resolved manually (See CONFLICT RESOLUTION above).
The status database associates item metadata with the pair of collections that were being synchronised with each other (called a "mapping"). If the configuration changes, and different collections are being synchronised with each other, then the status data for their items no longer applies and is ignored. This prevents using accidentally using the wrong data when mappings have been reconfigured.
The algorithm is closely based on the original one for vdirsyncer(1). Further details are available at https://unterwaditzer.net/2016/sync-algorithm.html.
Deleting the status database will force pimsync(1) to synchronise both storages as if it were the first time it's ever seen both of them. Items that exist and are identical on both sides shall be fine, but items which are not identical will be considered in conflict (since pimsync(1) cannot unambiguously decide which one to keep).
PROTECTIONS
When all items in a collection are deleted, pimsync(1) will assume a user error, and refuse to operate in this collection. This behaviour can be disabled with the on_empty directive. See pimsync.conf(5) for further details.
CAVEATS
For storages of type vdir, checking whether an item was modified by an external process is subject to race conditions. Pimsync will first check that an item has not been modified, and then update it. If an external program updates the same item between the check and the modification, those changes will be lost. This issue is due to limitations in POSIX filesystem primitive. It is unlikely that it can be resolved.
EXAMPLES
Run daemon with verbose logging:
pimsync -v info daemon
Interactive conflict resolution for pair named contacts:
pimsync resolve-conflicts contacts
Show version and exit:
pimsync version
SEE ALSO
pimsync.conf(5), pimsync-migration(7), khal(1), todo(1)
DEVELOPMENT
For issues and general development inquiries, see the project home currently hosted at SourceHut:
STANDARDS
Calendaring Extensions to WebDAV (CalDAV) is implemented as specified in IETF RFC 4791.
vCard Extensions to WebDAV (CardDAV) is implemented as specified in IETF RFC 4791.
Service discovery is implemented as specified in IETF RFC 6764.
THANKS
Development of this project is possible thanks to funding and support from the NLnet foundation and the NGI Zero Entrust program of the European Commission. See:
A security audit was completed by Radically Open Security:
HISTORY
The vdirsyncer command was first implemented by Markus Unterwaditzer in 2014. Work on the pimsync command, closely inspired by vdirsyncer, was started by Hugo Barrera in 2022.
The acronym pim refers to personal information management.
AUTHORS
This implementation was developed by Hugo O. Barrera <hugo@whynothugo.nl>.
pimsync is an open source project, developed for anyone to use freely. If you would like to sponsor this project, see:
2025-03-31 |