Skip to content

Commit

Permalink
compression_level: fix levels, improve help text, add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Thorsten Eggert committed Feb 25, 2024
1 parent 61bf2e7 commit 8d2c5cb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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:

Expand Down
6 changes: 4 additions & 2 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8d2c5cb

Please sign in to comment.