blob: 0fd8466852721d0fd6b2b5c35342aa7e1d3c04cb (
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/remotes/*.json
[Service]
WorkingDirectory = /etc/btrfs/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
|