Added mbsync and vdirsyncer files
The checkmail script executes mbsync to sync local and remote mailboxes, notmuch to update the mail database, and afew to perform some initial tagging. Next, the calendarsync script executes vdirsyncer to sync local and remote calendars (Google Calendar in this case). At the moment, this is all that the calendarsync script does, but it may do more in the future. Both scripts are run automatically using systemd service timers. If I've configured them right, these services shouldn't execute if a network isn't available. If a network is available, the timers will activate every five minutes to perform the sync operations.
This commit is contained in:
parent
d368a03587
commit
f4897a126f
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=Check for new mail
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/home/alex/bin/checkmail
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Periodically fetch new mail
|
||||
|
||||
[Timer]
|
||||
OnBootSec=5min
|
||||
OnUnitActiveSec=5min
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=Sync calendar updates
|
||||
Wants=network-online.target
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/home/alex/bin/calendarsync
|
||||
StandardOutput=syslog
|
||||
StandardError=syslog
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Periodically updates calendars
|
||||
|
||||
[Timer]
|
||||
OnBootSec=5min
|
||||
OnUnitActiveSec=5min
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# sync with Google Calendar
|
||||
vdirsyncer sync google_calendar
|
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# sync with IMAP
|
||||
mbsync -Va
|
||||
|
||||
# update notmuch database
|
||||
notmuch new
|
||||
|
||||
# perform initial tagging
|
||||
afew --tag --new
|
Loading…
Reference in New Issue