B / Y / U / S
HOME À¥ È£½ºÆà µµ¸ÞÀÎ ¸Å´º¾ó °í°´Áö¿ø ¼³Á¤Á¤º¸ °èÁ¤½Åû 2024-12-23 Monday 
À¥ È£½ºÆÃ
# °øÁö »çÇ×
# ÀÚÁÖ ¹¯´Â Áú¹®
# Áú¹®°ú ´äº¯
# °¡ÀÔ ¹®ÀÇ
Ä¿¹Â´ÏƼ
# ÀÚÀ¯°Ô½ÃÆÇ
# ¸®´ª½ºÆÁ
# ¾ÆÀÌÅ¥ Å×½ºÆ®
# ³»È¨ ¼Ò°³
# °Ö·¯¸®
# ÀÚ·á½Ç

  ¸®´ª½ºÆÁ  Go Unix Power Tools Online Book Go Bash Guide
Read No. 190 article 2003-06-06 07:30:27
NickName   Ç®ºñ´©
Subject   Æ¯Á¤ µðºñ »çÀÌÁî È®ÀÎ ½ºÅ©¸³Æ®
#!/bin/bash

if [ $(whoami) = "root" ]; then

   echo -n "### DBNAME : " ; read dbname

   for i in $(mysql -e "use $dbname; show table status;"|awk \
     '{print $6,$8}'|sed -ne '/[0-9]/p');do
   size=$(( $size + $i ))
   done

else

   echo -n "### DBNAME : " ; read dbname
   echo -n "### DBUSER ( default $dbname ) : " ; read dbuser
     [ ! $dbuser ] && dbuser=$dbname
   echo -n "### DBPASS : " ; read dbpass

   for i in $(mysql -u$dbuser -p$dbpass -e "use $dbname; show \
      table status;"|awk '{print $6,$8}'|sed -ne '/[0-9]/p');do
   size=$(( $size + $i ))
   done

fi

echo "µðºñ »çÀÌÁî : $size bytes"
Regist Addr [ 210.219.138.57 ] ¸ñ·Ïº¸±â À­±Û ¾Æ·§±Û
Á¤±ÔÇ¥Çö½Ä [ »ó¼¼ °Ë»ö ]
Page Loading [ 0.02 Sec ] SQL Time [ 0 Sec ]

Copyleft 1999-2024 by JSBoard Open Project
Theme Designed by IDOO And follow GPL2

°³ÀÎÁ¤º¸ Ãë±Þ¹æħ ÀÌ¿ë ¾à°ü »çÀÌÆ® ¸Ê ¾îµå¹Î °ü¸®