From 39abee7c6f482cb131982e8e0d67c00c27a0191b Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 7 Feb 2023 14:37:38 +0100 Subject: [PATCH] Add more generic script for transferring database --- bin/bin/dbbackup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 bin/bin/dbbackup.sh diff --git a/bin/bin/dbbackup.sh b/bin/bin/dbbackup.sh new file mode 100755 index 0000000..e4d2339 --- /dev/null +++ b/bin/bin/dbbackup.sh @@ -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}