Skip to content
Snippets Groups Projects
Verified Commit d714600c authored by nfontrod's avatar nfontrod
Browse files

src/main.rs: add compact subcommand

parent 3736d053
No related branches found
No related tags found
No related merge requests found
use crate::compact::Compact;
use crate::delete::Delete; use crate::delete::Delete;
use crate::prune::Prune; use crate::prune::Prune;
use clap::{Args, Parser, Subcommand}; use clap::{Args, Parser, Subcommand};
mod checkout; mod checkout;
mod commit; mod commit;
mod compact;
mod create_hooks; mod create_hooks;
mod delete; mod delete;
mod diff; mod diff;
...@@ -66,6 +68,8 @@ enum Commands { ...@@ -66,6 +68,8 @@ enum Commands {
/// ///
/// You can visit: /// You can visit:
/// https://borgbackup.readthedocs.io/en/stable/usage/delete.html for more details /// https://borgbackup.readthedocs.io/en/stable/usage/delete.html for more details
///
/// This function don't free disk space until gblk compact is used
Delete(Delete), Delete(Delete),
/// This command prunes the .borg repository. This can be used to keep only /// This command prunes the .borg repository. This can be used to keep only
/// archive created during a given time interval /// archive created during a given time interval
...@@ -74,7 +78,14 @@ enum Commands { ...@@ -74,7 +78,14 @@ enum Commands {
/// ///
/// You can visit: /// You can visit:
/// https://borgbackup.readthedocs.io/en/stable/usage/prune.html for more details /// https://borgbackup.readthedocs.io/en/stable/usage/prune.html for more details
///
/// This function don't free disk space until gblk compact is used
Prune(Prune), Prune(Prune),
/// This command frees repository space by compacting segments.
///
/// It is especially useful after deleting archives because compaction will
/// free repository space
Compact(Compact),
} }
#[derive(Debug, Args)] #[derive(Debug, Args)]
...@@ -253,5 +264,8 @@ fn main() { ...@@ -253,5 +264,8 @@ fn main() {
Commands::Prune(my_prune) => { Commands::Prune(my_prune) => {
prune::prune_launcher(my_prune); prune::prune_launcher(my_prune);
} }
Commands::Compact(my_compact) => {
compact::launch_compact(my_compact);
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment