update scripts

This commit is contained in:
2024-11-20 12:01:52 +01:00
parent 94e94ac553
commit 03e0047885
4 changed files with 44 additions and 16 deletions

17
update-database.sh Executable file
View 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