diff options
| author | Sam Scholten | 2025-09-11 16:06:10 +1000 |
|---|---|---|
| committer | Sam Scholten | 2025-09-11 16:06:10 +1000 |
| commit | a7115770e9e377689d9996abe32a28e8db87429d (patch) | |
| tree | 27d08eb347a8b38aeb47b7eb51050a85ff4c7876 /systemd | |
| download | drestic-a7115770e9e377689d9996abe32a28e8db87429d.tar.gz drestic-a7115770e9e377689d9996abe32a28e8db87429d.zip | |
init
Diffstat (limited to 'systemd')
| -rw-r--r-- | systemd/restic-backup.service | 17 | ||||
| -rw-r--r-- | systemd/restic-backup.timer | 9 | ||||
| -rw-r--r-- | systemd/restic-check.service | 17 | ||||
| -rw-r--r-- | systemd/restic-check.timer | 9 |
4 files changed, 52 insertions, 0 deletions
diff --git a/systemd/restic-backup.service b/systemd/restic-backup.service new file mode 100644 index 0000000..0c9ae2a --- /dev/null +++ b/systemd/restic-backup.service @@ -0,0 +1,17 @@ +[Unit] +Description=Restic Daily Backup +Wants=network-online.target +After=network.target network-online.target + +[Service] +Type=oneshot +# ExecStart path will be replaced by setup.sh during installation +ExecStart=/path/to/be/replaced/restic_backup.sh +# Environment variable will be set by setup.sh based on scope +Environment="HOME=/root" +# Memory limits to prevent OOM on VPS +MemoryMax=500M +MemorySwapMax=500M + +[Install] +WantedBy=timers.target diff --git a/systemd/restic-backup.timer b/systemd/restic-backup.timer new file mode 100644 index 0000000..a2c0b47 --- /dev/null +++ b/systemd/restic-backup.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run Restic Daily Backup + +[Timer] +OnCalendar=*-*-* 03:00:00 +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/systemd/restic-check.service b/systemd/restic-check.service new file mode 100644 index 0000000..66d87f1 --- /dev/null +++ b/systemd/restic-check.service @@ -0,0 +1,17 @@ +[Unit] +Description=Restic Weekly Repository Integrity Check +Wants=network-online.target +After=network.target network-online.target + +[Service] +Type=oneshot +# ExecStart path will be replaced by setup.sh during installation +ExecStart=/path/to/be/replaced/restic_check.sh +# Environment variable will be set by setup.sh based on scope +Environment="HOME=/root" +# Memory limits to prevent OOM on VPS +MemoryMax=500M +MemorySwapMax=500M + +[Install] +WantedBy=timers.target diff --git a/systemd/restic-check.timer b/systemd/restic-check.timer new file mode 100644 index 0000000..4d14b37 --- /dev/null +++ b/systemd/restic-check.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run Restic Weekly Repository Integrity Check + +[Timer] +OnCalendar=weekly +Persistent=true + +[Install] +WantedBy=timers.target |
