- btrfs-progs
- sqlite >= 3
- Install Rust.
- Clone the repo.
- Run
cargo build --release
cp target/release/rusnapshot /usr/bin/
- Create a snapshot using a config file:
sudo rusnapshot --config {{path/to/config.toml}} --create
- List created snapshots:
sudo rusnapshot -c {{path/to/config.toml}} --list
- Delete a snapshot by ID or the name of the snapshot:
sudo rusnapshot -c {{path/to/config.toml}} --del --id {{snapshot_id}}
- Delete all
hourly
snapshots:
sudo rusnapshot -c {{path/to/config.toml}} --list --keep {{0}} --clean --kind {{hourly}}
- Create a read-write snapshot:
sudo rusnapshot -c {{path/to/config.toml}} --create --rw
- Restore a snapshot:
sudo rusnapshot --id {{snapshot_id}} --restore
- You can use system variables to work with rusnapshot, the variables needs to be set with the
RUSNAPSHOT_
prefix followed by oned of the strings avilable in the config example, for exampleRUSNAPSHOT_DATABASE_FILE=/path/to/database.sqlite
- The
--kind
option can have any value and allow you to have different "kinds" of snapshots for the same directory, see the services/timers examples for more info. - The
--prefix
option is used to declare the first part of the snapshot name.