Skip to content
Snippets Groups Projects
Commit e9869d58 authored by eerohuusko's avatar eerohuusko
Browse files

Lisätty shell scripti

parent 6a065ddd
Branches main
No related tags found
No related merge requests found
!/bin/bash
echo "Check if mysqld process is running (we need to dump database)"
if pgrep -x mysqld >/dev/null 2>&1
then
echo "Dumping all databases to all_databases_dump.sql. Password is empty if you haven't changed it"
mysqldump -u root -p --socket=/tmp/mariadb_kernel/mysqld.sock --all-databases > all_databases_dump.sql
else
echo "Please start MariaDB-Kernel and run the script again"
exit
fi
echo "Dumping all databases to all_databases_dump.sql
mysqldump -u root -p --socket=/tmp/mariadb_kernel/mysqld.sock –all-databases > all_databases_dump.sql
echo "Please go to menu: Kernel -> Shutdown All Kernels...
echo "Press enter after you have shutdown all kernels"
read -s
#check if python3 process is running (kernels are started with python3)
if pgrep python3 >/dev/null 2>&1
then
echo "Seems you forgot to Shutdown All Kernels..."
echo "Please got to menu: Kernel -> Shutdown All Kernels and run the script again"
else
rm -rf /home/jovyan/work/.db/
echo "Please start MariaDB-kernel by Starting new MariaDB Notebook. Wait kernel to go Idle-status before giving password (should be empty)\n"
mysql -u root -p --socket=/tmp/mariadb_kernel/mysqld.sock < all_databases_dump.sql
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment