Add more generic script for transferring database

This commit is contained in:
Tim 2023-02-07 14:37:38 +01:00
parent 55aeed421a
commit 39abee7c6f

8
bin/bin/dbbackup.sh Executable file
View File

@ -0,0 +1,8 @@
#/bin/sh
database=$1
command="cd dbmanager && ./bin/console db:backup ${database}"
name=$(ssh www-data@cemophora "${command}" | awk -F'-|\\.def' '{split($1,a," ")}$0=a[4]')
scp -C www-data@cemophora:/var/www/dbmanager/${name} ~/projects/dbmanager
cd ~/projects/dbmanager && ./bin/console db:purge ${database} && ./bin/console db:restore ${database} ${name}