Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make compression level adjustable #105

Merged
merged 2 commits into from
Feb 25, 2024
Merged

make compression level adjustable #105

merged 2 commits into from
Feb 25, 2024

Conversation

3eggert
Copy link

@3eggert 3eggert commented Feb 23, 2024

I added a simple method to use different compression levels. I used level 0 (no compression) and it made only little difference in file size:

-rw-rw-r-- 1 eggert eggert 51G Feb 23 14:01 open-android-backup-02-23-2024-11-52-03.7z # default
-rw-rw-r-- 1 eggert eggert 53G Feb 23 19:00 open-android-backup-02-23-2024-18-23-18.7z # level 0

but it is significantly faster. 7z is always used as before, it just uses the compression level.

@mrrfv
Copy link
Owner

mrrfv commented Feb 23, 2024

Looks good, but there some things that need to be done before this can be merged:

  1. The user should be presented with the choices [0 | 1 | 3 | 5 | 7 | 9 ] instead of 0-9 according to the 7-Zip documentation.
  2. You should also update the "Automation/Unattended Backups" section of the README so it includes information about the compression_level environment variable.
  3. The choice between compression levels currently doesn't sound very clear for people who never touched the 7-Zip CLI, I suggest that it's written similarly to below instead:
  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 "A larger number means better compression at the expense of RAM usage and backup speed."
  cecho "Press Enter to pick your preferred compression level."

@3eggert
Copy link
Author

3eggert commented Feb 25, 2024

I added the purposed changes.

@mrrfv mrrfv merged commit 3733f52 into mrrfv:master Feb 25, 2024
@mrrfv
Copy link
Owner

mrrfv commented Feb 25, 2024

Sweet, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants