summaryrefslogtreecommitdiff
path: root/src/push-btrfs.service
blob: c4ab87cf651605ab305ed61d1db41d7910397813 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[Unit]
Description = Btrfs Backup over SSH
ConditionUser = root
ConditionPathExistsGlob = /etc/btrfs-backup/remotes/*.json

[Service]
WorkingDirectory = /etc/btrfs-backup/remotes
ExecStart = bash -e -c '\
shopt -s failglob; \
units=(*.json); \
units=($${units[@]/.json/.timer}); \
units=($${units[@]/#/%p@}); \
systemctl enable --now "$${units[@]}"; \
entr -pnd -- true <<< . || true; \
'

[Install]
WantedBy=default.target