Various improvements

This commit is contained in:
ge
2022-10-08 19:37:22 +03:00
parent 67c8d4715a
commit 9276d0f738
10 changed files with 855 additions and 634 deletions

View File

@ -25,7 +25,6 @@ tgt_s3cmd() {
log "Run handler ${FUNCNAME[0]}()"
local uri
local src_path
uri="$1"
@ -44,7 +43,7 @@ tgt_s3cmd() {
# Set s3cmd comand. See s3cmd(1)
if [ -n "$s3cmd_config" ]; then
# Use configuration file
# shellcheck disable=SC2154
# shellcheck disable=SC2154,SC2086
set -- s3cmd $s3cmd_options --config "$s3cmd_config" \
put "${backups[@]}" "$uri"
elif [ -n "$s3_access_key" ] && \
@ -54,7 +53,7 @@ tgt_s3cmd() {
then
s3_region="${s3_region:-na}" # fallback to 'no available' region
# Use parameters provided from backup script
# shellcheck disable=SC2154
# shellcheck disable=SC2154,SC2086
set -- s3cmd $s3cmd_options \
--access_key="$s3_access_key" \
--secret_key="$s3_secret_key" \
@ -74,6 +73,7 @@ tgt_s3cmd() {
# ^^^ hide secret_key from output ^^^
# Upload backups
# shellcheck disable=SC2154
if "$@" 2>> "$__log_file"; then
: # Success
else