Update Install Restic Checks

main
Anthony 2024-02-29 21:35:12 +08:00
parent 78d5c272e9
commit 443f0deb85
1 changed files with 13 additions and 7 deletions

View File

@ -94,18 +94,24 @@ actions:
message: Database backup add-on is already installed on ${env.name}. Backup addon installation is not possible. message: Database backup add-on is already installed on ${env.name}. Backup addon installation is not possible.
installRestic: installRestic:
cmd [cp]: |- cmd [cp]: |-
if which dnf; then if ! which restic > /dev/null; then
dnf install epel-release echo "Restic not found, installing..."
dnf install restic if which dnf > /dev/null; then
dnf install -y epel-release
dnf install -y restic
else else
yum-config-manager --add-repo https://copr.fedorainfracloud.org/coprs/copart/restic/repo/epel-7/copart-restic-epel-7.repo yum-config-manager --add-repo https://copr.fedorainfracloud.org/coprs/copart/restic/repo/epel-7/copart-restic-epel-7.repo
yum-config-manager --enable copr:copr.fedorainfracloud.org:copart:restic yum-config-manager --enable copr:copr.fedorainfracloud.org:copart:restic
yum -y install restic yum -y install restic
yum-config-manager --disable copr:copr.fedorainfracloud.org:copart:restic yum-config-manager --disable copr:copr.fedorainfracloud.org:copart:restic
wget -O /etc/logrotate.d/backup-addon ${baseUrl}/scripts/backup-addon;
fi fi
user: root else
echo "Restic is already installed."
fi
# Ensure the backup-addon logrotate configuration is always updated
wget -O /etc/logrotate.d/backup-addon ${baseUrl}/scripts/backup-addon;
user: root
setSchedule: setSchedule:
- setGlobals: - setGlobals: