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

Installer for borg backup #39

Open
samirbilalmemon opened this issue Dec 3, 2024 · 1 comment
Open

Installer for borg backup #39

samirbilalmemon opened this issue Dec 3, 2024 · 1 comment

Comments

@samirbilalmemon
Copy link

Is your feature request related to a problem? Please describe.
Before I begin all credits go to beeboo (imabee#1337) from discord for the solution and the script.

The standalone binary releases for borg backup do not work. They complain about problems with libsomething.so files when you try to run them. We should make an installer to use the borg.tgz files that have these dependencies bundles in them. Ideally the installer should also let you select which version of borg to install as you need a specific version based on what the Borg server has.

Describe the solution you'd like
The script should be able to check glibc version and download the right files and extract them and add them to bashrc as aliases.

Additional context
Beeboo from discord shared his script, here it is.

function github_latest_version() {
    # Argument expects the author/repo format
    # e.g. swizzin/swizzin
    repo=$1
    curl -fsSLI -o /dev/null -w %{url_effective} https://github.com/${repo}/releases/latest | grep -o '[^/]*$'
}

function _download() {
    glib_version=$(dpkg-query -W -f='${Version}' libc6:amd64 | sed 's/^\([0-9]*\)\.\([0-9]*\)-.*/\1\2/')
    echo "Detected glib version: ${glib_version}"
    version=$(github_latest_version "borgbackup/borg")

    echo "Downloading latest borg version: ${version}"
    libraries_dl="https://github.com/borgbackup/borg/releases/download/${version}/borg-linux-glibc${glib_version}.tgz"
    tar xvf borg-linux-glibc${glib_version}.tgz

cat << EOF >> $HOME/.bashrc
alias borg="\$HOME/borg-dir/borg.exe"
alias borgfs="\$HOME/borg-dir/borg.exe mount"
EOF

echo 'Please run `source .bashrc` to add the `borg` and `borgfs` commands.'
}

_download
@brettpetch
Copy link
Owner

Not quite it... but I'll convert this into a PR later.

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

No branches or pull requests

2 participants