Last active
January 23, 2018 17:04
-
-
Save stuudmuffin/d94b7d9bb1d57eef455863addddd8ea5 to your computer and use it in GitHub Desktop.
Script to easily show how much storage your minecraft dynamp is using
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
host="127.0.0.1" | |
db="dynmap" | |
user="db_user_name" | |
pass="db_user_pass" | |
## an alternative to putting the password into the script ( "less secure" ) is to read the user input into the variable ( "more secure" ). | |
#echo "Enter password for $user: " | |
#read -s pass | |
#database sizes | |
dbsize=$(mysql -u $user -h $host -p$pass -se 'SELECT table_schema "DB Name", Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" FROM information_schema.tables WHERE table_schema = "'$db'";'); | |
echo $dbsize; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment