From 815e265e53f8ef3ddd3220072dc0ab0eb784cab8 Mon Sep 17 00:00:00 2001 From: sebastien Date: Wed, 17 Aug 2022 14:36:50 +0200 Subject: [PATCH] ver1.0 --- divers/rsync_conf_vm_transarc.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 divers/rsync_conf_vm_transarc.sh diff --git a/divers/rsync_conf_vm_transarc.sh b/divers/rsync_conf_vm_transarc.sh new file mode 100644 index 0000000..3a52269 --- /dev/null +++ b/divers/rsync_conf_vm_transarc.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +subject="Erreur synchronisation des fichiers de configuration LONS->DIJON" +body="Impossible de récupéré les fichier de conf sur le cluster de Lons" +body2="Erreur lors du déplacement des fichiers de configuration des VMs" +from="pve01.dijon.transarc.fr" +to="support@altinea.fr" + +rsync -aAX root@10.17.28.10:/etc/pve/nodes/*/qemu-server/*.conf /sync_conf/ +RSYNC_RCODE=$? + +if [ $RSYNC_RCODE -eq 1 ]; then + echo -e "Subject:${subject}\n${body}" | sendmail -f "${from}" -t "${to}" + exit 1; +fi + +mv /sync_conf/*.conf /etc/pve/nodes/pve01/qemu-server/ +MV_RCODE=$? + +if [ $MV_RCODE -eq 1 ]; then + echo -e "Subject:${subject}\n${body2}" | sendmail -f "${from}" -t "${to}" + exit 1; + +fi