侧边栏壁纸
  • 累计撰写 781 篇文章
  • 累计创建 1 个标签
  • 累计收到 1 条评论
标签搜索

实例

Dettan
2021-04-10 / 0 评论 / 0 点赞 / 87 阅读 / 2,383 字
温馨提示:
本文最后更新于 2022-04-30,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。
修改数据库名字
#!/bin/bash

mysqlconn=" mysql -uroot -paishang132465 "
old_db="aishang"
new_db="aishang_big"
$mysqlconn -e "CREATE DATABASE $new_db"
params=$($mysqlconn -N -e "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='$old_db'")
for name in $params;
do
$mysqlconn -e "RENAME TABLE $old_db.$name to $new_db.$name";
done;

$mysqlconn -e "DROP DATABASE $old_db"

            <div style="display:flex;width:100%;font-weight:600;font-size:1.5em;line-height:1.3;color:inherit;">
                <div data-root="true" style="max-width:100%;width:100%;white-space:unset;word-break:break-word;padding:3px 2px;">

重启tomcat

#!/bin/sh
sh /home/tomcat8080-/bin/shutdown.sh
sleep 3
pid=$(ps -ef | grep tomcat8080 | grep -v grep | grep -v $$ | awk '{print $2}')
echo $pid
if test -z $pid; then
  sh /home/tomcat8080-/bin/startup.sh
  echo success without kill
else
  kill -9 $pid
  sh /home/tomcat8080-/bin/startup.sh
  echo success with kill
fi
看日志
vim /srv/tomcat9/logs/catalina.out;
tail -f /srv/tomcat9/logs/catalina.out;
启动Tomcat
rm -rf /srv/tomcat9/logs/*;
sh /srv/tomcat9/bin/startup.sh;
sleep 1;
tail -f /srv/tomcat9/logs/catalina.out;
停止Tomcat
sh /srv/tomcat9/bin/shutdown.sh;
sleep 3;
ps -aux|grep /srv/tomcat9/bin | grep -v grep |awk '{print $2}' |xargs -I $ kill -9 $;
scp
::echo off
echo "Yby@2503"
scp -vrp -P 21722 C:\JAVA\software\apache-tomcat-9.0.37\webapps\ybysys\webpage\ root@192.168.5.12:/home/tomcat8080-/webapps/ybysys/webpage/ 
scp -vrp -P 21722 C:\JAVA\software\apache-tomcat-9.0.37\webapps\ybysys\WEB-INF\classes\com\ root@192.168.5.12:/home/tomcat8080-/webapps/ybysys/WEB-INF/classes/com/
scp -vrp -P 21722 C:\JAVA\software\apache-tomcat-9.0.37\webapps\ybysys\WEB-INF\classes\content\ root@192.168.5.12:/home/tomcat8080-/webapps/ybysys/WEB-INF/classes/content/
scp -vrp -P 21722 C:\JAVA\software\apache-tomcat-9.0.37\webapps\ybysys\WEB-INF\classes\export\ root@192.168.5.12:/home/tomcat8080-/webapps/ybysys/WEB-INF/classes/export/
scp -vrp -P 21722 C:\JAVA\software\apache-tomcat-9.0.37\webapps\ybysys\WEB-INF\classes\jeecg\ root@192.168.5.12:/home/tomcat8080-/webapps/ybysys/WEB-INF/classes/jeecg/
scp -vrp -P 21722 C:\JAVA\software\apache-tomcat-9.0.37\webapps\ybysys\WEB-INF\classes\online\ root@192.168.5.12:/home/tomcat8080-/webapps/ybysys/WEB-INF/classes/online/
scp -vrp -P 21722 C:\JAVA\software\apache-tomcat-9.0.37\webapps\ybysys\WEB-INF\classes\org\ root@192.168.5.12:/home/tomcat8080-/webapps/ybysys/WEB-INF/classes/org/
pause



0

评论区