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

feat: add a Bash script to help Linux user manage Backrest #187

Merged
merged 2 commits into from
Apr 7, 2024

Conversation

Nebulosa-Cat
Copy link
Contributor

This Bash script include those feature:

  1. Install / Update / Uninstall Backrest
  2. Start / Stop / Check Status of Backrest

When it install Backrest it will check CPU/Kernel tpye ( x86_64, Armv6, Arm64), if not those type it should stop the install process.

After check CPU/Kernel tpye, it will use wget to download the correct version of Backrest install pack from newest release. Then create a folder/path name "backrest" under /home/username, then unpackage the install pack the install pack and run installer.sh inside it, after that it will clean the install file (remove the /home/username/backrest).

Uninstall feature is same as install but excute the uninstall.sh script.

other feature use sudo systemctl command to manage it.

Which plateform this script should support:
Linux running on x86_64, armv6~v8 CPU/Kernel

I have test the x86_64 and Armv8, other version I don't have device or enviroment to test it.

This Bash script include those feature:

1. Install / Update / Uninstall Backrest
2. Start / Stop / Check Status of Backrest

When it install Backrest it will check CPU/Kernel tpye ( x86_64, Armv6, Arm64), if not those type it should stop the install process.

After check CPU/Kernel tpye, it will use `wget` to download the correct version of Backrest install pack from newest release. Then create a folder/path name "backrest" under `/home/username`, then unpackage the install pack the install pack and run installer.sh inside it, after that it will clean the install file (remove the `/home/username/backrest`).

Uninstall feature is same as install but excute the `uninstall.sh` script.

other feature use `sudo systemctl` command to manage it.
@garethgeorge
Copy link
Owner

Hey! Thanks for sending this out, just pinging in to let you know this is on my plate -- will aim to merge this weekend after I've had some time to play with this, test on MacOS, possibly cover usage in the docs.

@Nebulosa-Cat
Copy link
Contributor Author

and if possible I think might be need to notice if user's restic, rclone is install as root or they need to backup root file (like /root or /var) maybe need use "sudo" when they run this script

when the user install not use sudo get.sh will create a systemd using user (user) and user (group)
config file will in /home/user/.config/backrest
cache file will in /home/user/.local/share/backrest, the /home/user/.local/share/backrest/restic-0.16.4 or similar file's permission should be rwxr-xr-x, this must be check or the all backup function or index will error.
image

if use sudo get.sh to install this will install as root use
config file will in /root/.config/backrest
cache file will in /root/.local/backrest

and all restic or rclone config file should in same user (any user or root)

@garethgeorge garethgeorge merged commit d78bcfa into garethgeorge:main Apr 7, 2024
@garethgeorge
Copy link
Owner

Hey thanks for contributing this! I just noticed after merging that you have a header re: attributions. I hope it's alright if I go ahead and update your website / author comment to a link to your github, I'm thinking this

#=================================================
#	System Required: Linux
#	Description: Backrest Helper
#	Contributed-By: https://github.com/Nebulosa-Cat
#=================================================

I'm a bit more comfortable with that relative to an arbitrary domain -- hope that's alright :)

Otherwise looks awesome.

@Nebulosa-Cat
Copy link
Contributor Author

sure, I forget this lol
link to my github page is much better and this is why this script shold commit to this repo not just link from my repo, 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