Create script to create, transfer and restore database backup

This commit is contained in:
Tim 2022-09-19 17:45:37 +02:00
parent 78bb71d83c
commit a4c7603591

5
bin/bin/blbackup Executable file
View File

@ -0,0 +1,5 @@
#/bin/sh
name=$(ssh www-data@cemophora 'cd dbmanager && ./bin/console db:backup bluelinked' | 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:restore bluelinked ${name}