From 3314ca5c4afc5e4744ba16df6767d3ad312464b7 Mon Sep 17 00:00:00 2001 From: "L. Kraven" Date: Thu, 13 Jun 2024 21:50:49 -0700 Subject: [PATCH] added autorestic units. --- autorestic-backup.service | 7 +++++++ autorestic-backup.timer | 7 +++++++ autorestic-prune.service | 6 ++++++ autorestic-prune.timer | 7 +++++++ 4 files changed, 27 insertions(+) create mode 100644 autorestic-backup.service create mode 100644 autorestic-backup.timer create mode 100644 autorestic-prune.service create mode 100644 autorestic-prune.timer diff --git a/autorestic-backup.service b/autorestic-backup.service new file mode 100644 index 0000000..87ee27c --- /dev/null +++ b/autorestic-backup.service @@ -0,0 +1,7 @@ +[Unit] +Description=Autorestic backup service +[Service] +Type=oneshot +ExecStart=autorestic backup --verbose --all +ExecStartPost=autorestic forget --verbose --all +WorkingDirectory=/srv/backups/autorestic diff --git a/autorestic-backup.timer b/autorestic-backup.timer new file mode 100644 index 0000000..6c1aadd --- /dev/null +++ b/autorestic-backup.timer @@ -0,0 +1,7 @@ +[Unit] +Description=Backup with autorestic daily +[Timer] +OnCalendar="*-*-* 03:*:*" +Persistent=true +[Install] +WantedBy=timers.target diff --git a/autorestic-prune.service b/autorestic-prune.service new file mode 100644 index 0000000..954a645 --- /dev/null +++ b/autorestic-prune.service @@ -0,0 +1,6 @@ +[Unit] +Description=Autorestic backup service (data pruning) +[Service] +Type=oneshot +ExecStart=autorestic forget --verbose --all --prune +WorkingDirectory=/srv/backups/autorestic/ diff --git a/autorestic-prune.timer b/autorestic-prune.timer new file mode 100644 index 0000000..146dc56 --- /dev/null +++ b/autorestic-prune.timer @@ -0,0 +1,7 @@ +[Unit] +Description=Prune data from the restic repository monthly +[Timer] +OnCalendar=monthly +Persistent=true +[Install] +WantedBy=timers.target