script de sauvegarde de nextcloud
This commit is contained in:
parent
2653221559
commit
7d6b15844a
16
roles/nxc-traefik/files/savenextcloud.sh
Normal file
16
roles/nxc-traefik/files/savenextcloud.sh
Normal file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Mettre le serveur NextCloud en mode maintenance
|
||||
docker compose exec -u www-data app php occ maintenance:mode --on
|
||||
|
||||
# Extraire les dossiers de sauvegarde
|
||||
cd /root/nxc
|
||||
|
||||
# Copie locale de la sauvegarde
|
||||
rsync -Aavx nextcloud/ nextcloud-dirbkp_`date +"%Y%m%d"`/
|
||||
|
||||
# Base de données MySQL/MariaDB
|
||||
docker compose exec db mysqldump -u nextcloud -pAzerty1+ nextcloud > nextcloud-sqlbkp_`date +"%Y%m%d"`.bak
|
||||
|
||||
# Sortir du mode maintenance
|
||||
docker compose exec -u www-data app php occ maintenance:mode --off
|
Loading…
x
Reference in New Issue
Block a user