mirror of
https://github.com/edu4rdshl/rusnapshot.git
synced 2026-07-17 23:24:55 +00:00
Add config templates, services and timers examples.
This commit is contained in:
parent
84530ec971
commit
f95e71f033
10 changed files with 92 additions and 0 deletions
16
examples/config-templates/config-all.toml
Normal file
16
examples/config-templates/config-all.toml
Normal 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"
|
||||
5
examples/config-templates/config-home.toml
Normal file
5
examples/config-templates/config-home.toml
Normal 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"
|
||||
5
examples/config-templates/config-root.toml
Normal file
5
examples/config-templates/config-root.toml
Normal 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"
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
# Example configuration file for rustnapshot
|
||||
# These are all the current available options
|
||||
|
||||
# Snapshots directory
|
||||
dest_dir = "/mnt/defvol/_snapshots/"
|
||||
|
|
@ -8,6 +9,8 @@ source_dir = "/mnt/defvol/_active/root/"
|
|||
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"
|
||||
|
|
|
|||
12
examples/services/rusnapshot-monthly.service
Normal file
12
examples/services/rusnapshot-monthly.service
Normal 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
|
||||
9
examples/services/rusnapshot-monthly.timer
Normal file
9
examples/services/rusnapshot-monthly.timer
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Take system snapshots monthly.
|
||||
|
||||
[Timer]
|
||||
OnCalendar=monthly
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
12
examples/services/rusnapshot-three-hours.service
Normal file
12
examples/services/rusnapshot-three-hours.service
Normal 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
|
||||
9
examples/services/rusnapshot-three-hours.timer
Normal file
9
examples/services/rusnapshot-three-hours.timer
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Take snapshots every 3 hours.
|
||||
|
||||
[Timer]
|
||||
OnBootSec=1h
|
||||
OnUnitActiveSec=3h
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
12
examples/services/rusnapshot-weekly.service
Normal file
12
examples/services/rusnapshot-weekly.service
Normal 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
|
||||
9
examples/services/rusnapshot-weekly.timer
Normal file
9
examples/services/rusnapshot-weekly.timer
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Take system snapshots weekly.
|
||||
|
||||
[Timer]
|
||||
OnCalendar=weekly
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
Loading…
Add table
Add a link
Reference in a new issue