From 443f0deb856f561e29c2e03cd558de4eb98a0911 Mon Sep 17 00:00:00 2001 From: Anthony Date: Thu, 29 Feb 2024 21:35:12 +0800 Subject: [PATCH] Update Install Restic Checks --- mbbackupmanager.jps | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/mbbackupmanager.jps b/mbbackupmanager.jps index 43e3171..afb2993 100644 --- a/mbbackupmanager.jps +++ b/mbbackupmanager.jps @@ -94,18 +94,24 @@ actions: message: Database backup add-on is already installed on ${env.name}. Backup addon installation is not possible. installRestic: - cmd [cp]: |- - if which dnf; then - dnf install epel-release - dnf install restic + cmd [cp]: |- + if ! which restic > /dev/null; then + echo "Restic not found, installing..." + if which dnf > /dev/null; then + dnf install -y epel-release + dnf install -y restic else 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 -y install restic yum-config-manager --disable copr:copr.fedorainfracloud.org:copart:restic - wget -O /etc/logrotate.d/backup-addon ${baseUrl}/scripts/backup-addon; - fi - user: root + fi + 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: - setGlobals: