feat: Add tar compression selection

This commit is contained in:
ge
2022-05-15 08:12:47 +03:00
parent 5b3f8dd15f
commit 1e124a6aa8
2 changed files with 36 additions and 6 deletions

View File

@ -20,7 +20,8 @@ __version='0.0.0'
__config=
__verbose=
__log_file='./log.txt'
__tar_options='-czf'
__tar_options='-acf'
__tar_compression='gzip'
__name_date_fmt='_%Y%m%d-%H%M'
if [ -n "$BAFLIB" ]; then
@ -121,10 +122,10 @@ log "Backup STARTED"
log -p "Configuration file: $([ "$__config" ] || echo not specified && echo "$__config")"
log "Scripts to process (${_count}): ${__args[@]}"
# TODO source config
for script in "${__args[@]}"; do
source_script "$script"
#. "$__config" # TODO Make it safe!
echo
echo -e "\e[1m==> Script: ${__args[_iter-1]##*/} [$_iter/$_count]\e[0m" | log -p
@ -162,6 +163,7 @@ for script in "${__args[@]}"; do
# Unset user defined variables
unset tar_options
unset tar_compression
unset name_date_fmt
done