[Dovecot] dsync in a cronjob to replace offlineimap
Hi list,
Replacing offlineimap with dsync for IMAP-to-IMAP synchronization (using dovecot 2.1.7) is working great, but now that I upgraded to 2.2.9 I'd like to take advantage of the incremental replication [1].
I don't think having a separate replicator process & notifications suits my configuration, as I want to sync my server with my laptop which is not always on or might be behind a firewall.
After reading ‘replication/replicator/dsync-client.c’ I was thinking of writing a small wrapper around dsync performing a daily full replication and updating the state otherwise.
The following works great in a cronjob
doveadm sync -l30 imap.example.org
but when I try to get the current state
doveadm sync -l30 -fs '' imap.example.org >~/mail/dsync.state
and later use incremental replication
state=$(< ~/mail/dsync.state) doveadm sync -l30 -s "$state" imap.example.org >~/mail/dsync.state
the state seems to somehow quickly become "stale" and messages stop being retrieved from the server.
I understand that dsync's incremental replication is mostly intended to be used by the replicator process, but I'm wondering whether it's also possible to use it manually ;-) If so, how to keep a sane state?
Thanks, cheers,
Guilhem.
Hi,
I'm in the exact same situation: trying to use a state file in a cron sync job on my laptop, it quickly becomes corrupted...
Is there a way to use incremental replication in this use case (sync between server and laptop)?
Thanks,
-- Félix
participants (2)
-
Félix Sipma
-
Guilhem Moulin