From 8acc4a6bff033db7291d701169beb8d5c278f3eb Mon Sep 17 00:00:00 2001 From: Edu4rdSHL Date: Sun, 30 Jan 2022 22:12:21 -0500 Subject: [PATCH] Add rusnapshot configs. Signed-off-by: Edu4rdSHL --- etc/rusnapshot/config-containers.toml | 5 +++++ etc/rusnapshot/config-home.toml | 5 +++++ etc/rusnapshot/config-root.toml | 5 +++++ etc/systemd/system/rusnapshot-daily.service | 11 +++++++++++ etc/systemd/system/rusnapshot-daily.timer | 9 +++++++++ etc/systemd/system/rusnapshot-monthly.service | 12 ++++++++++++ etc/systemd/system/rusnapshot-monthly.timer | 9 +++++++++ etc/systemd/system/rusnapshot-weekly.service | 12 ++++++++++++ etc/systemd/system/rusnapshot-weekly.timer | 9 +++++++++ 9 files changed, 77 insertions(+) create mode 100644 etc/rusnapshot/config-containers.toml create mode 100644 etc/rusnapshot/config-home.toml create mode 100644 etc/rusnapshot/config-root.toml create mode 100644 etc/systemd/system/rusnapshot-daily.service create mode 100644 etc/systemd/system/rusnapshot-daily.timer create mode 100644 etc/systemd/system/rusnapshot-monthly.service create mode 100644 etc/systemd/system/rusnapshot-monthly.timer create mode 100644 etc/systemd/system/rusnapshot-weekly.service create mode 100644 etc/systemd/system/rusnapshot-weekly.timer diff --git a/etc/rusnapshot/config-containers.toml b/etc/rusnapshot/config-containers.toml new file mode 100644 index 0000000..87c1fd5 --- /dev/null +++ b/etc/rusnapshot/config-containers.toml @@ -0,0 +1,5 @@ +dest_dir = "/mnt/defvol/_snapshots/" +source_dir = "/var/lib/machines/" +database_file = "/mnt/defvol/_snapshots/rustnapshot.sqlite" +snapshot_prefix = "containers" +keep_only = "1" diff --git a/etc/rusnapshot/config-home.toml b/etc/rusnapshot/config-home.toml new file mode 100644 index 0000000..b11bf54 --- /dev/null +++ b/etc/rusnapshot/config-home.toml @@ -0,0 +1,5 @@ +dest_dir = "/mnt/defvol/_snapshots/" +source_dir = "/home/" +database_file = "/mnt/defvol/_snapshots/rustnapshot.sqlite" +snapshot_prefix = "home" +keep_only = "1" diff --git a/etc/rusnapshot/config-root.toml b/etc/rusnapshot/config-root.toml new file mode 100644 index 0000000..aebb782 --- /dev/null +++ b/etc/rusnapshot/config-root.toml @@ -0,0 +1,5 @@ +dest_dir = "/mnt/defvol/_snapshots/" +source_dir = "/" +database_file = "/mnt/defvol/_snapshots/rustnapshot.sqlite" +snapshot_prefix = "root" +keep_only = "1" diff --git a/etc/systemd/system/rusnapshot-daily.service b/etc/systemd/system/rusnapshot-daily.service new file mode 100644 index 0000000..fab3b65 --- /dev/null +++ b/etc/systemd/system/rusnapshot-daily.service @@ -0,0 +1,11 @@ +[Unit] +Description=Snapshot root and home directories. + +[Service] +Type=oneshot +ExecStart=/usr/bin/rusnapshot -c /etc/rusnapshot/config-root.toml --cr --clean --kind daily +ExecStart=/usr/bin/rusnapshot -c /etc/rusnapshot/config-home.toml --cr --clean --kind daily +# ExecStart=/usr/bin/rusnapshot -c /etc/rusnapshot/config-containers.toml --cr --clean --kind daily + +[Install] +WantedBy=default.target \ No newline at end of file diff --git a/etc/systemd/system/rusnapshot-daily.timer b/etc/systemd/system/rusnapshot-daily.timer new file mode 100644 index 0000000..81f1abd --- /dev/null +++ b/etc/systemd/system/rusnapshot-daily.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Take snapshots daily. + +[Timer] +OnCalendar=daily +Persistent=true + +[Install] +WantedBy=timers.target \ No newline at end of file diff --git a/etc/systemd/system/rusnapshot-monthly.service b/etc/systemd/system/rusnapshot-monthly.service new file mode 100644 index 0000000..ac9eefd --- /dev/null +++ b/etc/systemd/system/rusnapshot-monthly.service @@ -0,0 +1,12 @@ +[Unit] +Description=Take system snapshots monthly. + +[Service] +Type=oneshot +ExecStart=/usr/bin/rusnapshot -c /etc/rusnapshot/config-root.toml --cr --clean --kind monthly +ExecStart=/usr/bin/rusnapshot -c /etc/rusnapshot/config-root.toml --cr --clean --kind monthly --rw +ExecStart=/usr/bin/rusnapshot -c /etc/rusnapshot/config-home.toml --cr --clean --kind monthly +ExecStart=/usr/bin/rusnapshot -c /etc/rusnapshot/config-home.toml --cr --clean --kind monthly --rw + +[Install] +WantedBy=default.target \ No newline at end of file diff --git a/etc/systemd/system/rusnapshot-monthly.timer b/etc/systemd/system/rusnapshot-monthly.timer new file mode 100644 index 0000000..88eb6fd --- /dev/null +++ b/etc/systemd/system/rusnapshot-monthly.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Take system snapshots monthly. + +[Timer] +OnCalendar=monthly +Persistent=true + +[Install] +WantedBy=timers.target \ No newline at end of file diff --git a/etc/systemd/system/rusnapshot-weekly.service b/etc/systemd/system/rusnapshot-weekly.service new file mode 100644 index 0000000..25ad102 --- /dev/null +++ b/etc/systemd/system/rusnapshot-weekly.service @@ -0,0 +1,12 @@ +[Unit] +Description=Take system snapshots weekly. + +[Service] +Type=oneshot +ExecStart=/usr/bin/rusnapshot -c /etc/rusnapshot/config-root.toml --cr --clean --kind weekly +ExecStart=/usr/bin/rusnapshot -c /etc/rusnapshot/config-root.toml --cr --clean --kind weekly --rw +ExecStart=/usr/bin/rusnapshot -c /etc/rusnapshot/config-home.toml --cr --clean --kind weekly +ExecStart=/usr/bin/rusnapshot -c /etc/rusnapshot/config-home.toml --cr --clean --kind weekly --rw + +[Install] +WantedBy=default.target \ No newline at end of file diff --git a/etc/systemd/system/rusnapshot-weekly.timer b/etc/systemd/system/rusnapshot-weekly.timer new file mode 100644 index 0000000..8126e47 --- /dev/null +++ b/etc/systemd/system/rusnapshot-weekly.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Take system snapshots weekly. + +[Timer] +OnCalendar=weekly +Persistent=true + +[Install] +WantedBy=timers.target \ No newline at end of file