Backup complet du système sur un support externe
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.

29 lines
728B

  1. #!/bin/bash
  2. # backup <PARTUUID destination>
  3. set -e
  4. # Montage du système de la brique sur le hôte
  5. echo -e "\033[33mMontage du support de sauvegarde...\033[0m"
  6. mount PARTUUID=$1 /mnt
  7. # Arrêt des services de la brique
  8. echo -e "\033[33mArrêt des Services...\033[0m"
  9. systemctl stop {gitea,mysql,postfix,metronome,dovecot}
  10. # Synchro
  11. echo -e "\033[33mSynchronisation des données...\033[0m"
  12. rsync -av --delete-after --progress --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /mnt/
  13. # Mise en route des services
  14. echo -e "\033[33mRedémarrage des Services...\033[0m"
  15. systemctl start {gitea,mysql,postfix,metronome,dovecot}
  16. echo -e "\033[32mTerminé !\033[0m"
  17. umount /mnt
  18. exit 0