sql="create table if not exists db_log.$tmp_table like db_log.$table; alter table db_log.$table rename db_log.$bak_table; alter table db_log.$tmp_table rename db_log.$table; "
echo "split_table `date +'%F %H:%M:%S'` start fileSize[$fsize B],rename[$table to $bak_table]" $mysql_c "$sql" #执行切表 echo "split_table `date +'%F %H:%M:%S'` end fileSize[$fsize B],rename[$table to $bak_table]" }
case "$1" in splitTable) #指定表切割 if [ -n "$2" ];then table="$2" split_table return fi