Skip to content

A Bash script for viewing, selecting and perform actions on multiple ZFS datasets by various grouping.

Notifications You must be signed in to change notification settings

norsemangrey/zfs-snapshot-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

ZFS Snapshot Manager

Description: This Bash script is made to help manage ZFS snapshots and custom dataset properties. It provides various options to list, select, and modify snapshots and properties of datasets in a ZFS pool.

Usage:

  1. Make sure the script has execute permissions (chmod +x zfs_snapshot_manager.sh).
  2. Run the script using ./zfs_snapshot_manager.sh.
  3. The script provides a menu-driven interface with the following options:
    • Show Summary / Totals: Display summary total counts for datasets and snapshots.
    • List Datasets by Property: List datasets based on a selected snapshot property.
    • List Snapshots by Name: List snapshots based on a selected snapshot name.
    • List Snapshots by Hold: List snapshots based on a selected hold tag.
    • Change Root: Change the root dataset for data collection.
    • Quit: Exit the script.
  4. For each of the listing options the user can select all or a selection of the datasets/snapshots and perform actions on these.

Options:

  • By default, the script will execute ZFS commands with elevated privileges (sudo) when required (e.g., for 'destroy', 'create', 'snapshot', and 'set' operations).
  • The script supports a dry run mode ('-d' or '--dry-run') where no ZFS commands will be executed, allowing you to preview actions before applying them.

Note:

  • The script assumes the user has sudo privileges to run ZFS commands.
  • Please ensure that the root dataset provided with the --root option exists and is accessible.
  • The script will exclude datasets with names containing any string in the variable exclude_datasets (used for instance to exclude datasets created by Docker).

About

A Bash script for viewing, selecting and perform actions on multiple ZFS datasets by various grouping.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages