docker instead of nerdctl and minor changes
This commit is contained in:
26
scripts/vol-restore
Executable file
26
scripts/vol-restore
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Run this script as root inside a service directory.
|
||||
# The backup have to be in the same directory.
|
||||
#
|
||||
|
||||
# Extract the archive into volumes directory
|
||||
BACKUP=${PWD##*/}.tar.zst
|
||||
if [ -d "volumes" ]; then
|
||||
rm -r volumes
|
||||
fi
|
||||
mkdir volumes
|
||||
tar --zstd --same-owner -xvf $BACKUP -C volumes
|
||||
|
||||
# Start the service and populate db from sql file if needed
|
||||
if [ -f "compose.db-restore.yml" ]
|
||||
then
|
||||
docker compose -f compose.yml -f compose.db-restore.yml up -d
|
||||
else
|
||||
docker compose up -d
|
||||
fi
|
||||
|
||||
# Clean backup files
|
||||
rm $BACKUP
|
||||
rm volumes/*.sql
|
||||
Reference in New Issue
Block a user