From a4c7603591e56b3f1df62b6e4935b4d817b41027 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 19 Sep 2022 17:45:37 +0200 Subject: [PATCH] Create script to create, transfer and restore database backup --- bin/bin/blbackup | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 bin/bin/blbackup diff --git a/bin/bin/blbackup b/bin/bin/blbackup new file mode 100755 index 0000000..ef6a241 --- /dev/null +++ b/bin/bin/blbackup @@ -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}