Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
content:serverbasics:docker-backup [2025/03/26 16:35] – [UserIDs in the Borg-Backups] Danielcontent:serverbasics:docker-backup [2025/04/14 19:21] (aktuell) – [Setup Scripts] Daniel
Zeile 11: Zeile 11:
 Create the Directory for your Backup- Scripts, e.g. /home/docker/docker_compose/backup Create the Directory for your Backup- Scripts, e.g. /home/docker/docker_compose/backup
  
-Inside that directory, create a file named "additional_backup_directories_initial" and insert the content: +Inside that directory, create a file named "''additional_backup_directories_initial''" and insert the content:
 <file> <file>
 /home/docker/docker_compose /home/docker/docker_compose
Zeile 38: Zeile 37:
 find "/home/docker/.local/share/docker/volumes" -maxdepth 1 -type d | grep pcserver2023>> ${DIRECTORYFILE} find "/home/docker/.local/share/docker/volumes" -maxdepth 1 -type d | grep pcserver2023>> ${DIRECTORYFILE}
  
-TODO: remove Database- Directories+Remove Database- Directories 
 +sed -i '/pgsql_data/d' ${DIRECTORYFILE} 
 + 
 +# Make Postgres-Backup of Authentik 
 +../authentik/docker_backup_authentik_db.sh
  
 # Copy the file to NC-AIO # Copy the file to NC-AIO
Zeile 59: Zeile 62:
 echo "The Log is:" echo "The Log is:"
 docker logs nextcloud-aio-borgbackup docker logs nextcloud-aio-borgbackup
-And start the Containers+ 
 +At this Point all Services should be shutdown despite the AIO-Mastercontainer 
 +# while some services tend to hang sometimes, i now want to completely shutdown everything 
 +/home/docker/bin/docker stop -t 180 $(/home/docker/bin/docker ps -a -q) 
 +/home/docker/bin/docker rm $(/home/docker/bin/docker ps -a -q) 
 +# and even kill docker-service and restart again 
 +systemctl --user restart docker 
 +# now, restart first NC-AIO Mastercontainer for further jobs 
 +cd /home/docker/docker_compose/nextcloud_aio 
 +/home/docker/bin/docker compose up -d 
 + 
 +# Start the NC-AOI Services by AIO
 sleep 2 sleep 2
 docker exec -it --env START_CONTAINERS=1 nextcloud-aio-mastercontainer /daily-backup.sh docker exec -it --env START_CONTAINERS=1 nextcloud-aio-mastercontainer /daily-backup.sh
Zeile 74: Zeile 88:
  
 Thats the whole Backup-Script. Thats the whole Backup-Script.
 +
  
 ===== Cronjob ===== ===== Cronjob =====
  
-Use ''crontab -e'' to create the cronjob for user docker on your host:+Frist, create another file in that Directory e.g. /home/docker/docker_compose/backup/docker_backup_cron.sh with the contents:
  
 <file> <file>
-0 1 * * * /home/docker/docker_compose/backup/docker_backup_all.sh+#!/bin/bash 
 +cd /home/docker/docker_compose/backup 
 +./docker_backup_all.sh> docker_backup_cron.log 2>&
 +cat docker_backup_cron.log
  
 </file> </file>
 +
 +Use ''crontab -e'' to create the cronjob for user docker on your host:
 +<code>0 3 * * * /home/docker/docker_compose/backup/docker_backup_cron.sh
 +
 +</code>
 +
 +Thats all. Make sure, you recieve Mails for this user.
 +
 +
 ===== UserIDs in the Borg-Backups ===== ===== UserIDs in the Borg-Backups =====
  
  • content/serverbasics/docker-backup.1743006958.txt.gz
  • Zuletzt geändert: 2025/03/26 16:35
  • von Daniel