summaryrefslogtreecommitdiff
path: root/push-btrfs.service
diff options
context:
space:
mode:
Diffstat (limited to 'push-btrfs.service')
-rw-r--r--push-btrfs.service9
1 files changed, 8 insertions, 1 deletions
diff --git a/push-btrfs.service b/push-btrfs.service
index ec9d3cd..7d32080 100644
--- a/push-btrfs.service
+++ b/push-btrfs.service
@@ -1,10 +1,17 @@
1[Unit] 1[Unit]
2Description = Btrfs Backup over SSH 2Description = Btrfs Backup over SSH
3ConditionUser = root 3ConditionUser = root
4ConditionPathExistsGlob = /etc/btrfs-backup/remotes/*.json
4 5
5[Service] 6[Service]
6WorkingDirectory = /etc/btrfs-backup/remotes 7WorkingDirectory = /etc/btrfs-backup/remotes
7ExecStart = bash -c 'shopt -s nullglob; for f in *.json; do (set -x; systemctl enable push-btrfs@$$f.timer); done' 8ExecStart = bash -e -c 'shopt -s failglob; \
9 units=(*.json); \
10 units=($${units[@]/.json/.timer}); \
11 units=($${units[@]/#/%p@}); \
12 systemctl enable "$${units[@]}"; \
13 entr -pnd -- true <<< . || true; \
14 '
8 15
9[Install] 16[Install]
10WantedBy=default.target 17WantedBy=default.target