mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-09 22:41:03 +01:00
solved docker volume backup renaming bug
This commit is contained in:
parent
c20158e400
commit
0aacd81f6e
@ -81,7 +81,7 @@ server_docker-compose build &&
|
||||
server_docker-compose -p akaunting up -d --force-recreate
|
||||
|
||||
# recover all volumes
|
||||
cd /home/administrator/scripts/server_docker-volume-backup &&
|
||||
cd /home/administrator/scripts/docker-volume-backup &&
|
||||
bash server_docker-volume-recover.sh akaunting_akaunting-modules ${machine_id:0:64} "$backup_version" &&
|
||||
bash server_docker-volume-recover.sh akaunting_akaunting-data ${machine_id:0:64} "$backup_version" &&
|
||||
bash server_docker-volume-recover.sh akaunting_akaunting-db ${machine_id:0:64} "$backup_version" akaunting-db "$akaunting_db_password" akaunting
|
||||
|
@ -13,7 +13,7 @@ NEXTCLOUD_APPLICATION_DOCKER_CONTAINER=nextcloud-application-1
|
||||
To update the nextcloud container execute the following commands on the server:
|
||||
```bash
|
||||
docker exec -it -u www-data $NEXTCLOUD_APPLICATION_DOCKER_CONTAINER /var/www/html/occ maintenance:mode --on
|
||||
sudo python /home/administrator/scripts/server_docker-volume-backup/server_docker-volume-backup.py
|
||||
sudo python /home/administrator/scripts/docker-volume-backup/docker-volume-backup.py
|
||||
export COMPOSE_HTTP_TIMEOUT=600
|
||||
export DOCKER_CLIENT_TIMEOUT=600
|
||||
cd /home/administrator/server_docker-compose/nextcloud && server_docker-compose down
|
||||
@ -57,8 +57,8 @@ and disable the not functioning apps.
|
||||
```bash
|
||||
cd /home/administrator/server_docker-compose/nextcloud &&
|
||||
server_docker-compose down &&
|
||||
docker exec -i nextcloud_database_1 mysql -u nextcloud -pPASSWORT nextcloud < "/Backups/$(sha256sum /etc/machine-id | head -c 64)/server_docker-volume-backup/latest/nextcloud_database/sql/backup.sql" &&
|
||||
cd /home/administrator/scripts/server_docker-volume-backup &&
|
||||
docker exec -i nextcloud_database_1 mysql -u nextcloud -pPASSWORT nextcloud < "/Backups/$(sha256sum /etc/machine-id | head -c 64)/docker-volume-backup/latest/nextcloud_database/sql/backup.sql" &&
|
||||
cd /home/administrator/scripts/docker-volume-backup &&
|
||||
bash ./server_docker-volume-recover.sh "nextcloud_data" "$(sha256sum /etc/machine-id | head -c 64)"
|
||||
```
|
||||
|
||||
|
@ -30,7 +30,7 @@ waiting_time=600
|
||||
backup_running=True
|
||||
while backup_running:
|
||||
try:
|
||||
bash("systemctl is-active --quiet server_docker-volume-backup.service")
|
||||
bash("systemctl is-active --quiet docker-volume-backup.service")
|
||||
print("backup is running.")
|
||||
print("trying again in " + str(waiting_time) + " seconds.")
|
||||
time.sleep(waiting_time)
|
||||
|
@ -1 +1 @@
|
||||
docker_volume_backup_folder: "/home/administrator/scripts/server_docker-volume-backup/"
|
||||
docker_volume_backup_folder: "/home/administrator/scripts/docker-volume-backup/"
|
@ -10,8 +10,8 @@ fi
|
||||
get_hashed_machine_id="sha256sum /etc/machine-id";
|
||||
get_backup_types="find /Backups/{{hashed_machine_id.stdout}}/ -maxdepth 1 -type d -execdir basename {} ;";
|
||||
|
||||
# @todo This configuration is not scalable yet. If other backup services then server_docker-volume-backup are integrated, this logic needs to be optimized
|
||||
get_static_last_version_dir="readlink -f /Backups/{{hashed_machine_id.stdout}}/server_docker-volume-backup/latest"
|
||||
# @todo This configuration is not scalable yet. If other backup services then docker-volume-backup are integrated, this logic needs to be optimized
|
||||
get_static_last_version_dir="readlink -f /Backups/{{hashed_machine_id.stdout}}/docker-volume-backup/latest"
|
||||
rsync_command="sudo rsync --server --sender -blogDtpre.iLsfxCIvu . $($get_static_last_version_dir)/"
|
||||
|
||||
# filter commands
|
||||
|
Loading…
Reference in New Issue
Block a user