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: