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.

28 lines
739 B

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