update scripts
This commit is contained in:
17
update-database.sh
Executable file
17
update-database.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Dumping DB...."
|
||||
ssh mstiller@maketank.net mysqldump -C --result-file=/tmp/mstillersql1.sql mstillersql1
|
||||
echo "Copying here"
|
||||
scp -C mstiller@maketank.net:/tmp/mstillersql1.sql /tmp/
|
||||
echo 'Dropping local'
|
||||
mariadb --skip-ssl -u root -h localhost --password=rootpW --port=3306 \
|
||||
-e 'drop database mstillersql1; create database mstillersql1'
|
||||
echo 'Importing new...'
|
||||
mariadb --skip-ssl -u root -h localhost --password=rootpW --port=3306 \
|
||||
mstillersql1 </tmp/mstillersql1.sql
|
||||
mariadb --skip-ssl -u root -h localhost --password=rootpW --port=3306 mstillersql1 < changeurl.sql
|
||||
|
||||
echo 'Cleanup'
|
||||
rm /tmp/mstillersql1.sql
|
||||
ssh mstiller@maketank.net rm /tmp/mstillersql1.sql
|
||||
Reference in New Issue
Block a user