Add config templates, services and timers examples.

This commit is contained in:
Edu4rdSHL 2021-04-19 12:34:02 -05:00
parent 84530ec971
commit f95e71f033
No known key found for this signature in database
GPG key ID: 3A574A4009F553E5
10 changed files with 92 additions and 0 deletions

View file

@ -0,0 +1,16 @@
# Example configuration file for rustnapshot
# These are all the current available options
# Snapshots directory
dest_dir = "/mnt/defvol/_snapshots/"
# Directory to be snapshoted
source_dir = "/mnt/defvol/_active/root/"
# SQLite database file PATH, created if no exists, recommended to be in the snapshots dir
database_file = "/mnt/defvol/_snapshots/rustnapshot.sqlite"
# Prefix for the snapshots, they will be saved in the format prefix-$current_date
snapshot_prefix = "root"
# Snapshots identifier
snapshot_kind = "weekly"
# Last snapshots to keep. If prefix is specified then only the snapshots with that prefix
# are deleted
keep_only = "2"

View file

@ -0,0 +1,5 @@
dest_dir = "/mnt/defvol/_snapshots/"
source_dir = "/home/"
database_file = "/mnt/defvol/_snapshots/rustnapshot.sqlite"
snapshot_prefix = "home"
keep_only = "2"

View file

@ -0,0 +1,5 @@
dest_dir = "/mnt/defvol/_snapshots/"
source_dir = "/"
database_file = "/mnt/defvol/_snapshots/rustnapshot.sqlite"
snapshot_prefix = "root"
keep_only = "2"

View file

@ -1,4 +1,5 @@
# Example configuration file for rustnapshot # Example configuration file for rustnapshot
# These are all the current available options
# Snapshots directory # Snapshots directory
dest_dir = "/mnt/defvol/_snapshots/" dest_dir = "/mnt/defvol/_snapshots/"
@ -8,6 +9,8 @@ source_dir = "/mnt/defvol/_active/root/"
database_file = "/mnt/defvol/_snapshots/rustnapshot.sqlite" database_file = "/mnt/defvol/_snapshots/rustnapshot.sqlite"
# Prefix for the snapshots, they will be saved in the format prefix-$current_date # Prefix for the snapshots, they will be saved in the format prefix-$current_date
snapshot_prefix = "root" snapshot_prefix = "root"
# Snapshots identifier
snapshot_kind = "weekly"
# Last snapshots to keep. If prefix is specified then only the snapshots with that prefix # Last snapshots to keep. If prefix is specified then only the snapshots with that prefix
# are deleted # are deleted
keep_only = "2" keep_only = "2"

View file

@ -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

View file

@ -0,0 +1,9 @@
[Unit]
Description=Take system snapshots monthly.
[Timer]
OnCalendar=monthly
Persistent=true
[Install]
WantedBy=timers.target

View file

@ -0,0 +1,12 @@
[Unit]
Description=Snapshot root directory.
[Service]
Type=oneshot
ExecStart=/usr/bin/rusnapshot -c /etc/rusnapshot/config-root.toml --cr --clean --kind three-hours
ExecStart=/usr/bin/rusnapshot -c /etc/rusnapshot/config-root.toml --cr --clean --kind three-hours --rw
ExecStart=/usr/bin/rusnapshot -c /etc/rusnapshot/config-home.toml --cr --clean --kind three-hours
ExecStart=/usr/bin/rusnapshot -c /etc/rusnapshot/config-home.toml --cr --clean --kind three-hours --rw
[Install]
WantedBy=default.target

View file

@ -0,0 +1,9 @@
[Unit]
Description=Take snapshots every 3 hours.
[Timer]
OnBootSec=1h
OnUnitActiveSec=3h
[Install]
WantedBy=timers.target

View file

@ -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

View file

@ -0,0 +1,9 @@
[Unit]
Description=Take system snapshots weekly.
[Timer]
OnCalendar=weekly
Persistent=true
[Install]
WantedBy=timers.target