File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,4 +54,5 @@ borg_user: "root"
5454borg_group : " root"
5555backup_user_info :
5656 home : " /home/{{ borg_user }}"
57+ borgmatic_run_as_root : false
5758...
Original file line number Diff line number Diff line change @@ -232,3 +232,7 @@ argument_specs:
232232 type : str
233233 required : false
234234 description : Comment added to the SSH public key.
235+ borgmatic_run_as_root :
236+ type : bool
237+ required : false
238+ description : If the variable is set, systemd will run borgmatic using sudo.
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ ConditionACPower=true
1212[Service]
1313Type=oneshot
1414User={{ borg_user }}
15- ExecStart={{ 'sudo ' if borg_user != 'root' }}borgmatic -c /etc/borgmatic/{{ borgmatic_config_name }} {{ borgmatic_timer_flags }}
15+ ExecStart={{ 'sudo ' if borgmatic_run_as_root }}borgmatic -c /etc/borgmatic/{{ borgmatic_config_name }} {{ borgmatic_timer_flags }}
1616
1717# Source: https://projects.torsion.org/borgmatic-collective/borgmatic/raw/branch/master/sample/systemd/borgmatic.service
1818# Security settings for systemd running as root, optional but recommended to improve security. You
You can’t perform that action at this time.
0 commit comments