Systemd timer for syncoid

I have a bash script called syncoid-job which boils down to a barebones -


syncoid --no-sync-snap --sendoptions=w --no-privilege-elevation $SYNOIC_USER@$SERVER:tank/encrypted/nas tank/encrypted/nas

I want to run this script hourly but as my user (notice the no-privilege-elevation flag)

First - create a systemd unit file at /etc/systemd/system/syncoid-replication.service

Description=ZFS Replication With Syncoid



Then we save the unit file, enable the service, and then start it

systemctl enable syncoid-replication.service
systemctl start syncoid-replication.service

Note this will run that script... so be ready for syncoid to do its thing

Now for the timer... We create /etc/systemd/system/syncoid-replication.timer

Description=Run syncoid-replication every hour



Hit it with a systemctl enable syncoid-replication.timer and you're in business!