Skip to content

Conversation

@buildplan
Copy link
Owner

Changes

  • The script now checks for -h / --help immediately upon execution. This allows to read the documentation without entering a root password or waiting for dependency checks.

  • The PATH variable is now appended (:$PATH) instead of overwritten, ensuring custom binaries in the user's environment are still accessible.

  • Added a cleanup trap improvement that sends pkill to child processes, ensuring that if the script is cancelled (Ctrl+C), the underlying restic process terminates immediately.

  • Added a pre-flight check to ensure at least 500MB of free space exists in the cache directory/tmp before starting a backup.

buildplan added 2 commits December 17, 2025 09:10
- Moved `display_help` to top and added early argument scanning to allow
  viewing help without requiring `sudo` or triggering dependency checks.
- Updated `PATH` export to append to existing system path rather than
  overwriting it, preserving custom environment paths.
- Enhanced `cleanup()` to kill child processes (orphans) upon script exit
  or interruption.
- Added pre-flight check for 500MB free disk space in cache directory to
  prevent restic crashes.
- Removed unreachable `--help` case from main execution block.
@buildplan buildplan self-assigned this Dec 17, 2025
@buildplan buildplan added the enhancement New feature or request label Dec 17, 2025
@buildplan buildplan merged commit daabd67 into main Dec 17, 2025
4 checks passed
@buildplan buildplan deleted the help_without_sudo branch December 17, 2025 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants