Alleditor
Alleditor
/bin/bash
exit 1
fi
op=$(mysql --login-path=admin_server -e "select ip as
ip_addr,mysql_password,ssh_port from admin.database_list_master where
id="$source_server_id)
pass=$(echo ${op} | cut -d ' ' -f5)
ip_addr=$(echo ${op} | cut -d ' ' -f4)
ssh_port=$(echo ${op} | cut -d ' ' -f6)
disk_space_flag='true'
df -h | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $6 " " $4 }' | while read
-r output;
do
partition=$(echo "$output" | awk '{ print $1}')
usage=$(echo "$output" | awk '{ print $2 }' )
n_free="${usage%?}"
p_usage=${usage: -1}
if [ "$p_usage" = "G" ] && [ "$partition" = "/" ]; then
if [ "$n_free" -lt 5 ]; then
disk_space_flag='false'
fi
fi
if [ "$p_usage" = "G" ] && [ "$partition" = "/var" ]; then
if [ "$n_free" -lt 10 ]; then
disk_space_flag='false'
fi
fi
done
if [ $disk_space_flag='true' ]; then
if [ -d /var/lib/mysql/$target_db ] ; then
count=$(find /var/lib/mysql/$target_db -maxdepth 1 -type f|wc -l)
if [ "$count" -eq 1 ]; then