borgmatic.service 697 B

123456789101112131415161718192021222324
  1. [Unit]
  2. Description=borgmatic backup
  3. Wants=network-online.target
  4. After=network-online.target
  5. ConditionACPower=true
  6. [Service]
  7. Type=oneshot
  8. # Lower CPU and I/O priority.
  9. Nice=19
  10. CPUSchedulingPolicy=batch
  11. IOSchedulingClass=best-effort
  12. IOSchedulingPriority=7
  13. IOWeight=100
  14. Restart=no
  15. # Prevent rate limiting of borgmatic log events. If you are using an older version of systemd that
  16. # doesn't support this (pre-240 or so), you may have to remove this option.
  17. LogRateLimitIntervalSec=0
  18. # Delay start to prevent backups running during boot.
  19. ExecStartPre=sleep 1m
  20. ExecStart=systemd-inhibit --who="borgmatic" --why="Prevent interrupting scheduled backup" /root/.local/bin/borgmatic --syslog-verbosity 1