diff --git a/server/help_text/backup b/server/help_text/backup new file mode 100644 index 00000000..8a4de5be --- /dev/null +++ b/server/help_text/backup @@ -0,0 +1,37 @@ +███████ ██  ██ ██  ██ ████████  █████  ██████  ██  ███████ +██      ██  ██   ██  ██     ██    ██   ██ ██   ██ ██  ██ +███████ █████    ████   ██  ███████ ██████  ██  █████ +     ██ ██  ██   ██   ██  ██   ██ ██   ██ ██  ██ +███████ ██  ██  ██  ██  ██  ██ ██████  ███████ ███████ + +Skytable {version} | https://github.com/skytable/skytable +Copyright (c) Sayan N. + +Skytable database server daemon (skyd): data backup utility + +Details: + The `backup` subcommand is used to back up database data into a reliable format + for easily restoring database data without manual intervention. + +Usage: skyd backup [FLAGS] [OPTIONS] + +Options: + --path (required) Path to the backup that is to be created + +Flags: + --verify-integrity Must verify integrity before backing up + --unsafe-allow-dirty (unsafe) Copy files as-is, even if the database is running + and in a (potentially) dirty state + +Examples: + skyd backup --verify-integrity --path /mnt/nfsbackups/mybackup-DDMMYYYY + +Notes: + - The backup pointed to must be a manifest based backup. Otherwise it cannot be + restored using this tool and needs manual intervention + - If you use the `--unsafe-allow-other-host` flag you must guarantee that it is ok + to restore a backup from a potentially different node + - `--verify-integrity` is almost always unnecessary as on startup `skyd` will always + verify the integrity of the on-disk data. + +{further_assistance} \ No newline at end of file diff --git a/server/help_text/compact b/server/help_text/compact index f51ff5c0..e6c9d714 100644 --- a/server/help_text/compact +++ b/server/help_text/compact @@ -9,6 +9,11 @@ Copyright (c) Sayan N. Skytable database server daemon (skyd): database file optimization utility +Details: + The `compact` subcommand optimizes the database files by removing any stale or deleted + data and/or applying other operations. This can help improve database performance, + efficiency and reduce disk usage. + Usage: skyd compact Examples: diff --git a/server/help_text/help b/server/help_text/help index 2082b518..cd296590 100644 --- a/server/help_text/help +++ b/server/help_text/help @@ -9,12 +9,18 @@ Copyright (c) Sayan N. Skytable database server daemon (skyd) +Details: + The Skytable database server daemon starts the database server and listens for database + requests at the given endpoints based on the provided configuration. + Usage: skyd [FLAGS] [OPTIONS] skyd [FLAGS] [OPTIONS] [COMMAND] [OPTIONS] Commands: repair Check and repair any detected database storage errors compact Force optimize all database files + backup Back up database data + restore Restore data from an existing backup Flags: -h, --help Display this help menu and exit. diff --git a/server/help_text/repair b/server/help_text/repair index b4225c67..f6977419 100644 --- a/server/help_text/repair +++ b/server/help_text/repair @@ -9,6 +9,10 @@ Copyright (c) Sayan N. Skytable database server daemon (skyd): database repair utility +Details: + The `repair` subcommand checks the integrity of all database files and attempts to repair + any files that are found to have issues such as data corruption or inconsistencies. + Usage: skyd repair Examples: diff --git a/server/help_text/restore b/server/help_text/restore index 2501c7d9..cd784b4c 100644 --- a/server/help_text/restore +++ b/server/help_text/restore @@ -9,14 +9,18 @@ Copyright (c) Sayan N. Skytable database server daemon (skyd): data restore utility +Details: + The `restore` subcommand is used to restore data from an existing manifest-based + backup located at the given path. + Usage: skyd restore [FLAGS] [OPTIONS] skyd restore [FLAGS] [OPTIONS] -Required options: +Options: --path (required) Path to the backup that is to be restored Flags: - --verify-integrity Must verify integrity before backing up + --verify-integrity Must verify integrity before restoring data --unsafe-allow-other-host (unsafe) Enable restoring backup from a different host Examples: diff --git a/server/src/engine/config.rs b/server/src/engine/config.rs index 7a7e44dc..76d2ceab 100644 --- a/server/src/engine/config.rs +++ b/server/src/engine/config.rs @@ -658,6 +658,7 @@ fn arg_decode_rs_window( pub(super) const TXT_HELP: &str = include_str!(concat!(env!("OUT_DIR"), "/skyd-help")); pub(super) const TXT_HELP_REPAIR: &str = include_str!(concat!(env!("OUT_DIR"), "/skyd-repair")); pub(super) const TXT_HELP_COMPACT: &str = include_str!(concat!(env!("OUT_DIR"), "/skyd-compact")); +pub(super) const TXT_HELP_BACKUP: &str = include_str!(concat!(env!("OUT_DIR"), "/skyd-backup")); pub(super) const TXT_HELP_RESTORE: &str = include_str!(concat!(env!("OUT_DIR"), "/skyd-restore")); #[derive(Debug, PartialEq)] @@ -704,6 +705,7 @@ pub fn parse_cli_args<'a, T: ArgItem>( CliMultiCommand::SubcommandHelp(_, subcommand) => match subcommand.name() { "repair" => CLIConfigParseReturn::Help(TXT_HELP_REPAIR.to_owned()), "compact" => CLIConfigParseReturn::Help(TXT_HELP_COMPACT.to_owned()), + "backup" => CLIConfigParseReturn::Help(TXT_HELP_BACKUP.to_owned()), "restore" => CLIConfigParseReturn::Help(TXT_HELP_RESTORE.to_owned()), _ => { return Err(ConfigError::with_src(