summaryrefslogtreecommitdiff
path: root/roles/storage/zfs/syncoid/templates/pull.service.j2
blob: 955161aa132898c2e19be16c7856a8b6683ecadf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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{% if 'periodic' not in item.value %} --create-bookmark{% endif %} --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