随笔分类 - shell
关于shell脚本的一些基础命令
摘要:操作目的:用supervisor工具管理tomcat服务 配置环境,安装服务,以及多实例 脚本编辑: 前提 机器的opt目录下必须有jdk-8u131-linux-x64_.rpm 以及apache-tomcat-8.5.35.tar.gz 1 #!/bin/bash 2 systemctl sto
阅读全文
摘要:1 #!/bin/bash 2 yum -y install rsync >/dev/null 3 cat >/etc/rsyncd.conf<<EOF 4 ##全局配置 5 uid = root 6 gid = root 7 use chroot = no 8 max connections =
阅读全文
摘要:#!/bin/bash . /etc/init.d/functions check_fun(){ url_list=(www.baidu.com www.tudou.com www.youku.com www.xxx22sfq2.com www.asdqwe.com) for i in ${url_
阅读全文
摘要:了解到几种加密密码的方式 myPassword用你想用的密码字符串代替 1.有OpenSSL的话,可以使用openssl命令: openssl passwd -crypt myPassword 2、如果用Apache Web服务器,那么也可以用htpasswd htpasswd -nd user 用
阅读全文
摘要:1. 通过位置变量创建 Linux 系统账户及密码 #!/bin/bash useradd "$1" echo "$2" |passwd --stdin "$1" .2. 每周 5 使用 tar 命令备份/var/log 下的所有日志文件编写脚本 #!/bin/bash tar -zcf log-`
阅读全文
摘要:linux 系统则是由 cron (crond) 这个系统服务来控制的。Linux 系统上面原本就有非常多的计划性工作,因此这个系统服务是默认启动的。另外, 由于用户自己也可以设置计划任务,所以,Linux 系统也提供了使用者控制计划任务的命令 :crontab 命令。 crond 是linux下用
阅读全文
摘要:都是一些最基本的信息 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 #!/bin/bash ##系统信息 #系统类型 OS_TYPE=`uname` #系统版本 OS_VER=`cat /etc/redhat-relea
阅读全文
摘要:一键部署nginx 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
阅读全文
摘要:shell 变量: name=”aaa” echo $name 注意事项: 变量名和等号之间不能有空格 不能使用标点符号 不能使用bash里的关键字 只读变量: name=”aaa” 关键字:readonly name 删除变量: unset name 变量类型: 1 局部变量: 局部变量在脚本或命
阅读全文

浙公网安备 33010602011771号