Switched Restic installation to use precompiled binary for reduced memory usage

main
Anthony 2025-01-04 00:48:58 +08:00
parent df8ab1cce8
commit 4fb8eef23b
1 changed files with 21 additions and 17 deletions

View File

@ -276,14 +276,19 @@ actions:
installRestic: installRestic:
cmd [cp]: |- cmd [cp]: |-
if which dnf >/dev/null 2>&1; then # Download the latest Restic release
dnf install -y epel-release curl -L https://github.com/restic/restic/releases/download/v0.15.2/restic_0.15.2_linux_amd64.bz2 -o restic.bz2
dnf install -y restic
else # Decompress the downloaded file
yum-config-manager --add-repo https://copr.fedorainfracloud.org/coprs/copart/restic/repo/epel-7/copart-restic-epel-7.repo bzip2 -d restic.bz2
yum-config-manager --enable copr:copr.fedorainfracloud.org:copart:restic
yum -y install restic # Make the binary executable
yum-config-manager --disable copr:copr.fedorainfracloud.org:copart:restic chmod +x restic
# Move it to a directory in your PATH
sudo mv restic /usr/local/bin/
# Set up log rotation for backup logs
echo "/var/log/backup_addon.log { echo "/var/log/backup_addon.log {
weekly weekly
rotate 52 rotate 52
@ -292,7 +297,6 @@ actions:
compress compress
copytruncate copytruncate
}" > /etc/logrotate.d/backup-addon }" > /etc/logrotate.d/backup-addon
fi
user: root user: root
importScripts: importScripts: