From 46fd75c013829d7cb67d8b237b4d199c9e5150fb Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Mon, 2 Jan 2023 21:15:39 -0800 Subject: [PATCH] Add systemd service and timer units --- snapraid-scrub.service | 8 ++++++++ snapraid-scrub.timer | 9 +++++++++ snapraid-sync.service | 8 ++++++++ snapraid-sync.timer | 9 +++++++++ 4 files changed, 34 insertions(+) create mode 100644 snapraid-scrub.service create mode 100644 snapraid-scrub.timer create mode 100644 snapraid-sync.service create mode 100644 snapraid-sync.timer diff --git a/snapraid-scrub.service b/snapraid-scrub.service new file mode 100644 index 0000000..53421ba --- /dev/null +++ b/snapraid-scrub.service @@ -0,0 +1,8 @@ +[Unit] +Description=Run SnapRAID scrub command + +[Service] +Type=oneshot +Nice=19 +IOSchedulingClass=idle +ExecStart=/usr/bin/snapraid scrub --plan full diff --git a/snapraid-scrub.timer b/snapraid-scrub.timer new file mode 100644 index 0000000..a0d20e2 --- /dev/null +++ b/snapraid-scrub.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Runs SnapRAID scrub monthly + +[Timer] +OnCalendar=Monthly, 02:00 +Persistent=true + +[Install] +WantedBy=timers.target diff --git a/snapraid-sync.service b/snapraid-sync.service new file mode 100644 index 0000000..66bf9dd --- /dev/null +++ b/snapraid-sync.service @@ -0,0 +1,8 @@ +[Unit] +Description=Run SnapRAID sync command + +[Service] +Type=oneshot +Nice=19 +IOSchedulingClass=idle +ExecStart=/usr/bin/snapraid sync diff --git a/snapraid-sync.timer b/snapraid-sync.timer new file mode 100644 index 0000000..0c17eca --- /dev/null +++ b/snapraid-sync.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Runs SnapRAID sync nightly + +[Timer] +OnCalendar=Mon-Sun, 01:00 +Persistent=true + +[Install] +WantedBy=timers.target