From 3891a608ff32a540f888cad4ba975cc81b72fd97 Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Mon, 2 Jan 2023 20:14:46 -0500 Subject: [PATCH] Fixed help text and better explained compression parameters --- README.md | 31 ++++++++++++++++++------------- mkstage4.sh | 4 ++-- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index eea4021..7bf1594 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,10 @@ emerge app-backup/mkstage4 *If you are running the script from the containing folder (first install method) please make sure you use the `./mkstage4.sh` command instead of just `mkstage4`!* +Note that the extension will automatically be appended to the `archive_name` string based on the compression type, which can be specifiled via the `-C` parameter, if another compression than the default (`.tar.bz2`) is desired. + +### Examples + Archive your current system (mounted at /): ```bash @@ -42,21 +46,22 @@ Archive a system located at a custom mount point: mkstage4 -t /custom/mount/point archive_name ``` -Command line arguments: +### Command line arguments ```console -mkstage4.sh [-q -c -b -l -k -p] [-s || -t ] [-e ] [custom-tar-options] - -q: activates quiet mode (no confirmation). - -c: excludes connman network lists. - -b: excludes boot directory. - -l: excludes lost+found directory. - -p: compresses parallelly using pbzip2. - -e: an additional excludes directory (one dir one -e). - -s: makes tarball of current system. - -k: separately save current kernel modules and src (creates smaller archives and saves decompression time). - -t: makes tarball of system located at the . - -C: specify tar compression (shows available on runtime and default is bz2) - -h: displays help message. +usage: + mkstage4 [-q -c -b -l -k] [-s || -t ] [-e ] [-i ] [custom-tar-options] + -q: activates quiet mode (no confirmation). + -c: excludes some confidential files (currently only .bash_history and connman network lists). + -b: excludes boot directory. + -l: excludes lost+found directory. + -e: an additional excludes directory (one dir one -e, donot use it with *). + -i: an additional target to include. This has higher precedence than -e, -t, and -s. + -s: makes tarball of current system. + -k: separately save current kernel modules and src (creates smaller archives and saves decompression time). + -t: makes tarball of system located at the . + -C: specify tar compression (default: bz2, available: lz4 xz bz2 zst gz). + -h: displays help message. ``` ## System Tarball Extraction diff --git a/mkstage4.sh b/mkstage4.sh index 1392b2f..06871f2 100755 --- a/mkstage4.sh +++ b/mkstage4.sh @@ -46,7 +46,7 @@ then fi USAGE="usage:\n\ - $(basename "$0") [-q -c -b -l -k -p] [-s || -t ] [-e ] [-i ] [custom-tar-options]\n\ + $(basename "$0") [-q -c -b -l -k] [-s || -t ] [-e ] [-i ] [custom-tar-options]\n\ -q: activates quiet mode (no confirmation).\n\ -c: excludes some confidential files (currently only .bash_history and connman network lists).\n\ -b: excludes boot directory.\n\ @@ -56,7 +56,7 @@ USAGE="usage:\n\ -s: makes tarball of current system.\n\ -k: separately save current kernel modules and src (creates smaller archives and saves decompression time).\n\ -t: makes tarball of system located at the .\n\ - -C: specify tar compression (available: ${!COMPRESS_AVAILABLE[*]}).\n\ + -C: specify tar compression (default: ${COMPRESS_TYPE}, available: ${!COMPRESS_AVAILABLE[*]}).\n\ -h: displays help message." # reads options: