diff --git a/backup.sh b/backup.sh index d5609a0..d9fe27c 100755 --- a/backup.sh +++ b/backup.sh @@ -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." diff --git a/functions/backup_func.sh b/functions/backup_func.sh index 0e3dc0d..b199f67 100644 --- a/functions/backup_func.sh +++ b/functions/backup_func.sh @@ -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