contrib: systemd: run units only with existing config file

It does not make sense for the timer or the service to be started (the latter
when done so manually) when neither of the two default config files exists.

Signed-off-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
pull/498/head
Christoph Anton Mitterer 2022-11-12 04:55:34 +01:00
parent 87eeefa0ca
commit c9d95a6302
2 changed files with 4 additions and 0 deletions

View File

@ -1,6 +1,8 @@
[Unit]
Description=btrbk backup
Documentation=man:btrbk(1)
ConditionPathExists=|@CONFDIR@/btrbk/btrbk.conf
ConditionPathExists=|@CONFDIR@/btrbk.conf
[Service]
Type=oneshot

View File

@ -1,5 +1,7 @@
[Unit]
Description=btrbk daily backup
ConditionPathExists=|@CONFDIR@/btrbk/btrbk.conf
ConditionPathExists=|@CONFDIR@/btrbk.conf
[Timer]
OnCalendar=hourly