LinuxCommandLibrary

rusnapshot

Create and manage Btrfs snapshots

TLDR

Create a snapshot using a configuration file

$ sudo rusnapshot [[-c|--config]] [path/to/config.toml] --cr
copy

List created snapshots
$ sudo rusnapshot [[-c|--config]] [path/to/config.toml] [[-l|--list]]
copy

Delete a snapshot by ID or the name of the snapshot
$ sudo rusnapshot [[-c|--config]] [path/to/config.toml] --del --id [snapshot_id]
copy

Delete all hourly snapshots
$ sudo rusnapshot [[-c|--config]] [path/to/config.toml] [[-l|--list]] [[-k|--keep]] [0] --clean --kind [hourly]
copy

Create a read-write snapshot
$ sudo rusnapshot [[-c|--config]] [path/to/config.toml] --cr [[-r|--rw]]
copy

Restore a snapshot
$ sudo rusnapshot [[-c|--config]] [path/to/config.toml] --id [snapshot_id] [[-r|--restore]]
copy

SYNOPSIS

rusnapshot [options] [arguments]

PARAMETERS

--version
    Display the version number of rusnapshot.

-h, --help
    Show help message and exit.

create
    Create a new snapshot of the specified volume.

list
    List all existing snapshots.

restore
    Restore the specified snapshot.

delete
    Delete the specified snapshot.

DESCRIPTION

The `rusnapshot` command is a utility for creating and managing snapshots of Linux filesystems. It provides a convenient way to create consistent backups and revert to previous states. Rusnapshot leverages the capabilities of LVM (Logical Volume Manager) or btrfs to create snapshots, ensuring data consistency. This allows for creating point-in-time copies of your data without interrupting ongoing operations. It enables backups and restoration without significant downtime.

Rusnapshot simplifies the process of taking, listing, and deleting snapshots. It abstracts away some of the complexities of directly using LVM or Btrfs commands, making snapshot management more accessible to users with varying levels of technical expertise. Key functionalities include creating snapshots, listing existing snapshots, reverting to a snapshot, and deleting snapshots. The tool can be used to regularly backup application servers and quickly restore the state if something went wrong.

CAVEATS

Requires root privileges to create, restore, and delete snapshots. Requires either LVM or Btrfs to be configured for the target filesystem.

BACKEND SUPPORT

Rusnapshot abstracts away the specific commands required for creating snapshots by the backend used. Currently it supports creating snapshots using LVM or btrfs filesystem tools. When rusnapshot needs to execute specific LVM or btrfs commands, they will be executed using sudo and the user needs to have enough privileges.

SEE ALSO

lvcreate(8), lvremove(8), btrfs(8)

Copied to clipboard