summaryrefslogtreecommitdiff
path: root/roles/storage/zfs/syncoid/templates/pull.service.j2
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-05-19 23:39:10 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-05-19 23:39:10 +0200
commit389f7be86f07a08a6282e02913a676aeef328db5 (patch)
treeb0548116d5d14fd62c1295d408d5e7086af9b9dd /roles/storage/zfs/syncoid/templates/pull.service.j2
parentsyncoid: autosuspend cleanup and cooldown (diff)
syncoid: run vs pull and fix autosuspend timer
Diffstat (limited to 'roles/storage/zfs/syncoid/templates/pull.service.j2')
-rw-r--r--roles/storage/zfs/syncoid/templates/pull.service.j222
1 files changed, 22 insertions, 0 deletions
diff --git a/roles/storage/zfs/syncoid/templates/pull.service.j2 b/roles/storage/zfs/syncoid/templates/pull.service.j2
new file mode 100644
index 00000000..33283576
--- /dev/null
+++ b/roles/storage/zfs/syncoid/templates/pull.service.j2
@@ -0,0 +1,22 @@
+[Unit]
+Description=syncoid-based backup for {{ item.key }}
+
+[Service]
+Type=oneshot
+{% for path,config in item.value.paths.items() %}
+ExecStart=/var/lib/syncoid/syncoid_wrapper --dumpsnaps --quiet {{ config.recursive | default(false) | ternary('-r ', '') }}{{ config.skip_parent | default(false) | ternary('--skip-parent ', '') }}{% for re in config.exclude | default([]) %}--exclude='{{ re }}' {% endfor %}{% if 'ssh_port' in item.value %}--sshport {{ item.value.ssh_port }} {% endif %}root@{{ item.value.ssh_hostname }}:{{ path }} {{ zfs_syncoid_target_pool }}/{{ item.key }}/{{ path }}
+{% endfor %}
+{% if zfs_syncoid_autosuspend %}
+ExecStart=/var/lib/syncoid/syncoid_post
+{% endif %}
+{% if 'periodic' in item.value %}
+TimeoutStartSec={{ item.value.periodic.timeout }}
+{% endif %}
+PrivateTmp=yes
+ProtectHome=yes
+ProtectKernelTunables=yes
+ProtectControlGroups=yes
+RestrictRealtime=yes
+
+[Install]
+WantedBy=multi-user.target