You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
707 B

2 years ago
  1. #!/bin/bash
  2. subject="Erreur synchronisation des fichiers de configuration LONS->DIJON"
  3. body="Impossible de récupéré les fichier de conf sur le cluster de Lons"
  4. body2="Erreur lors du déplacement des fichiers de configuration des VMs"
  5. from="pve01.dijon.transarc.fr"
  6. to="support@altinea.fr"
  7. rsync -aAX root@10.17.28.10:/etc/pve/nodes/*/qemu-server/*.conf /sync_conf/
  8. RSYNC_RCODE=$?
  9. if [ $RSYNC_RCODE -eq 1 ]; then
  10. echo -e "Subject:${subject}\n${body}" | sendmail -f "${from}" -t "${to}"
  11. exit 1;
  12. fi
  13. mv /sync_conf/*.conf /etc/pve/nodes/pve01/qemu-server/
  14. MV_RCODE=$?
  15. if [ $MV_RCODE -eq 1 ]; then
  16. echo -e "Subject:${subject}\n${body2}" | sendmail -f "${from}" -t "${to}"
  17. exit 1;
  18. fi