mirror of
https://github.com/kevinveenbirkenbach/docker-volume-backup.git
synced 2024-11-22 00:11:03 +01:00
Changed logic so that volume is not created for db recoveries
This commit is contained in:
parent
15a1f17184
commit
35e28f31d2
@ -22,9 +22,7 @@ backup_folder="Backups/$backup_hash/backup-docker-to-local/$version/$volume_name
|
|||||||
backup_files="/$backup_folder/files"
|
backup_files="/$backup_folder/files"
|
||||||
backup_sql="/$backup_folder/sql/$database_name.backup.sql"
|
backup_sql="/$backup_folder/sql/$database_name.backup.sql"
|
||||||
|
|
||||||
echo "Inspect volume $volume_name"
|
# DATABASE RECOVERY
|
||||||
docker volume inspect "$volume_name"
|
|
||||||
exit_status_volume_inspect=$?
|
|
||||||
|
|
||||||
if [ -f "$backup_sql" ]; then
|
if [ -f "$backup_sql" ]; then
|
||||||
if [ -n "$database_container" ] && [ -n "$database_password" ] && [ -n "$database_name" ]; then
|
if [ -n "$database_container" ] && [ -n "$database_password" ] && [ -n "$database_name" ]; then
|
||||||
@ -40,6 +38,12 @@ if [ -f "$backup_sql" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# FILE RECOVERY
|
||||||
|
|
||||||
|
echo "Inspect volume $volume_name"
|
||||||
|
docker volume inspect "$volume_name"
|
||||||
|
exit_status_volume_inspect=$?
|
||||||
|
|
||||||
if [ $exit_status_volume_inspect -eq 0 ]; then
|
if [ $exit_status_volume_inspect -eq 0 ]; then
|
||||||
echo "Volume $volume_name already exists"
|
echo "Volume $volume_name already exists"
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user