Add borg check and rename options

Because we added borg check functionality, some of the Options have been
renamed:
-C -> -V
-E -> -e (as it is a sub)

-C: check
-y: --verify-data
-p: prefix or glob for check

Internal variables with CHECK have been renamed or changed to VERIFY

Borg -C without any extra parameters is equal to borg check.
-y adds the --verify-data and -p is a mix of the -P and -a options. If
there is a "*" in the option then -a will be used, else -P

Note that repair command has to be run manually. Run -C with -v
(verbose) to see the repair command structure.

borg check can take a long time on very large repositories.
This commit is contained in:
2022-04-18 15:30:03 +09:00
parent b5ead9a2e1
commit 2ae05f5302
9 changed files with 190 additions and 103 deletions

View File

@@ -1,11 +1,10 @@
#!/usr/bin/env bash
# Run -I first to initialize repository
# There are no automatic repository checks unless -C is given
# Plain file backup
# set last edit date + time
MODULE="file";
MODULE_VERSION="1.2.0";
MODULE_VERSION="1.2.1";
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
@@ -14,10 +13,11 @@ if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
# include and exclude file
INCLUDE_FILE="borg.backup.file.include";
EXCLUDE_FILE="borg.backup.file.exclude";
# init check file
BACKUP_INIT_CHECK="borg.backup.file.init";
# init verify file
BACKUP_INIT_VERIFY="borg.backup.file.init";
. "${DIR}/borg.backup.functions.check.sh";
# verify valid data
. "${DIR}/borg.backup.functions.verify.sh";
# exit if include file is missing
if [ ! -f "${BASE_FOLDER}${INCLUDE_FILE}" ]; then