diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2024-01-28 16:15:33 +0100 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2024-01-28 16:24:48 +0100 |
commit | a5805855c4f55e47d5f8fac14f30e2d7dd802a87 (patch) | |
tree | e1821629b22fc78780e7db1f167d1eb919012ff8 /hbak/src | |
parent | 47fbe9e76d42cbc0ea8695afb9d23cb1da1f2ec3 (diff) |
implement node deinitialization
Diffstat (limited to 'hbak/src')
-rw-r--r-- | hbak/src/main.rs | 9 |
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()?; |