From 8d2c5cb40ef94a0551c2e351a198c23cafcd9496 Mon Sep 17 00:00:00 2001 From: Thorsten Eggert Date: Sun, 25 Feb 2024 13:50:27 +0100 Subject: [PATCH] compression_level: fix levels, improve help text, add documentation --- README.md | 3 ++- backup.sh | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d2fea0c..474c4ee 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ You need 3 functions in your hook for it to be properly initialized by the scrip Please keep in mind that this project has minimal support for automation and very little support will be provided. In order to export contacts, you still need to have physical access to the device you're backing up as an "unattended mode" for the companion app hasn't been implemented yet. -There are 9 environment variables that control what the script does without user input: +There are 10 environment variables that control what the script does without user input: 1. `unattended_mode` - Instead of waiting for a key press, sleeps for 5 seconds. Can be any value. 2. `selected_action` - What the script should do when run. Possible values are `Backup` and `Restore` (case sensitive). @@ -128,6 +128,7 @@ There are 9 environment variables that control what the script does without user 7. `use_hooks` - Whether to use hooks or not. Possible values are `yes` or `no` (case sensitive). 8. `data_erase_choice` - Whether to securely erase temporary files or not. Possible values are `Fast`, `Slow` and `Extra Slow` (case sensitive). The value of this variable is ignored if the command `srm` isn't present on your computer. 9. `discouraged_disable_archive` - Disables the creation of a backup archive, only creates a backup *directory* with no compression, encryption or other features. This is not recommended, although some may find it useful to deduplicate backups and save space. Restoring backups created with this option enabled is not supported by default; you must manually create an archive from the backup directory and then restore it. Possible values are `yes` or `no` (case sensitive). +10. `compression_level` - One of 0, 1, 3, 5, 7, 9. Where 9 is the best an slowest copression and 0 is no compression and the fastest level. If most of your data is already compressed, for example jpg pictures or mp3 videos, you will not loose much volume by compressing it. Examples: diff --git a/backup.sh b/backup.sh index d9fe27c..6b50922 100755 --- a/backup.sh +++ b/backup.sh @@ -98,12 +98,14 @@ clear if [ ! -v compression_level ]; then cecho "Choose the compression level." cecho "- 0 is no compression, and is the fastest." + cecho "- 3 is fast compression." + cecho "- 5 is normal compression, which is a balance between speed and file size." + cecho "- 7 is maximum compression, it was the previous default." 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' ) + compression_levels=( '0' '1' '3' '5' '7' '9' ) select_option_from_list "Choose the compression level" compression_levels[@] compression_level fi