aboutsummaryrefslogtreecommitdiff
path: root/hbak/src
diff options
context:
space:
mode:
Diffstat (limited to 'hbak/src')
-rw-r--r--hbak/src/main.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/hbak/src/main.rs b/hbak/src/main.rs
index 2a656d7..1516426 100644
--- a/hbak/src/main.rs
+++ b/hbak/src/main.rs
@@ -27,6 +27,12 @@ enum Commands {
/// The network address `hbakd` binds to. The default is `[::]:20406` (dual stack).
bind_addr: Option<SocketAddr>,
},
+ /// Fully clean the local node of non-binary files with optional backup removal.
+ Clean {
+ /// Remove the btrfs subvolumes that contain the snapshots and backups.
+ #[arg(short = 'b', long = "backups")]
+ backups: bool,
+ },
/// Mark a subvolume as owned by the local node.
Track {
/// The name of the subvolume to mark as owned.
@@ -107,6 +113,9 @@ fn logic() -> Result<()> {
let passphrase = rpassword::prompt_password("Enter new encryption passphrase: ")?;
system::init(device, bind_addr, node_name, passphrase)?;
}
+ Commands::Clean { backups } => {
+ system::deinit(backups)?;
+ }
Commands::Track { subvol } => {
let mut node_config = NodeConfig::load()?;