Skip to content

Commit

Permalink
make compession level adjustable
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorsten Eggert committed Feb 23, 2024
1 parent f2c7e83 commit 61bf2e7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@ fi

clear

if [ ! -v compression_level ]; then
cecho "Choose the compression level."
cecho "- 0 is no compression, and is the fastest."
cecho "- 9 is the slowest, but provides the best compression."
cecho "- 7 was the previous default"
cecho "Press Enter to pick your preferred compression level."
wait_for_enter

compression_levels=( '0' '1' '2' '3' '4' '5' '6' '7' '8' '9' )
select_option_from_list "Choose the compression level" compression_levels[@] compression_level
fi

clear

if [ ! -v use_hooks ]; then
cecho "Would you like to use hooks?"
cecho "Choose 'no' if you don't understand this question, or don't want to load hooks."
Expand Down
2 changes: 1 addition & 1 deletion functions/backup_func.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function backup_func() {
# -bb3: verbose logging
# The undefined variable (archive_password) is set by the user if they're using unattended mode
declare backup_archive="$archive_path/open-android-backup-$(date +%m-%d-%Y-%H-%M-%S).7z"
retry 5 7z a -p"$archive_password" -mhe=on -mx=7 -bb3 "$backup_archive" backup-tmp/*
retry 5 7z a -p"$archive_password" -mhe=on -mx=$compression_level -bb3 "$backup_archive" backup-tmp/*
fi

# We're not using 7-Zip's -sdel option (delete files after compression) to honor the user's choice to securely delete temporary files after a backup
Expand Down

0 comments on commit 61bf2e7

Please sign in to comment.