随笔分类 - shell
摘要:pos-admin.sh #!/bin/sh echo echo 自动化部署脚本启动 echo echo 停止原来运行中的工程 APP_NAME=pos-admin.jar ### APP_NAME = test.jar ### 这个地方的名称 就是pom 文件中的 artifactId , 但最好
阅读全文
摘要:我的是备份数据库,链接到数据库服务器来备份的 终端shell命令实现 远程连接服务器: mongo -host 10.202.***.** -port 27017 --authenticationDatabase xz** 导出远程服务器到本地: mongodump -host 10.202.***
阅读全文
摘要:“/etc/profile”文件中的“HISTFILESIZE”和“HISTSIZE”行确定所有用户的“.bash_history”文件中可以保 存的旧命令条数。 强烈建议把把“/etc/profile”文件中的“HISTFILESIZE”和“HISTSIZE”行的值设为一个较小的数,比如 30。编
阅读全文
摘要:lbw@lbw-kaleido:/home1 if test -z "$password" then password="123456" fi #ifend #
阅读全文
摘要:#!/bin/bash # 一次性处理git提交 #branch_name=`git symbolic-ref --short -q HEAD` branch_name=1" ] ;then commit
阅读全文
摘要:#!/bin/bash # 一次性处理git提交 #branch_name=`git symbolic-ref --short -q HEAD` branch_name=1" ] ;then commit
阅读全文
摘要:``` # 配置mysql备份 * * * * * sh /home/cron/back_mysql_db.sh >> /tmp/back_mysql_db.log 2>&1 ``` ``` #!/bin/bash # 没有则创建 if [ ! -d "/home/wwwroot/default/mysqlbackup" ];then mkdir -p "/home/wwwroot/default
阅读全文
摘要:# 配置mysql备份 00 03 * * * sh /home/cron/back_mysql_db.sh >> /tmp/back_mysql_db.log 2>&1 30 03 * * * /home/cron/scp_back_to_test.sh /home/wwwroot/default
阅读全文
摘要:shell 实现获取当前时间,并进行格式转换的方法: 1)原格式输出 2018年 09月 30日 星期日 15:55:15 CST 2)时间串输出 20180930155515 注意 1、date后面有一个空格,shell对空格要求严格 2、变量赋值前后不要有空格
阅读全文
摘要:* 定时器# 定期备份代码 * * * * * sh /home/cron/backup_code.sh >> /tmp/backup_code.log 2>&1 #!/bin/sh # 备份代码 basedir=/data/backup www_src=ww
阅读全文