摘要:
批量添加用户并设置随机密码,把添加的用户的名字和密码保存到文件中。[root@lamp scripts]# cat user.sh #!/bin/shfor i in `seq -w 10`do pass=$(echo "`date`$RANDOM"|md5sum|cut -c 1-8) ... 阅读全文
posted @ 2015-11-23 23:47
Nuwanda
阅读(2067)
评论(0)
推荐(0)
摘要:
先批量创建文件#!/bin/shif [ ! -d /tmp/chenyao ]then mkdir /tmp/chenyao -pficd /tmp/chenyaofor i in {1..10}do touch chenyao-$i.htmldone批量改名[root@lamp script... 阅读全文
posted @ 2015-11-23 22:31
Nuwanda
阅读(480)
评论(0)
推荐(0)
摘要:
示例:查看系统负载的脚本#!/bin/shwhile truedo uptime >/tmp/uptime.log sleep 1done[root@lamp scripts]# tail -f /tmp/uptime.log 21:37:26 up 5:49, 2 users, loa... 阅读全文
posted @ 2015-11-23 21:47
Nuwanda
阅读(1154)
评论(0)
推荐(0)
摘要:
/application/apache/logs/bbs-access_log日志文件中任意一行的格式如下,以空格为间隔第十列(2632)为此次请求内容的字节数大小192.168.220.1 - - [13/Oct/2015:21:55:16 +0800] "GET /install/images/... 阅读全文
posted @ 2015-11-23 21:30
Nuwanda
阅读(228)
评论(0)
推荐(0)
摘要:
自己写的MySQL的启动脚本脚本一:#!/bin/sh. /etc/init.d/functions[ $# -ne 1 ] && {echo "USAGE:{start|stop|restart}"exit 1}start(){if [ -e /data/3307/mysqld.pid ]then... 阅读全文
posted @ 2015-11-23 16:14
Nuwanda
阅读(4450)
评论(0)
推荐(0)
摘要:
监控一般通过脚本实现,使用定时任务定期执行检测。1.端口 本地:ss,netstat,lsof 远程:telnet,namp,nc2.本地进程数 例如: lsof -i:80|wc -l ps -ef|grep nginx|wc -l nmap 192.168.220.139... 阅读全文
posted @ 2015-11-23 16:11
Nuwanda
阅读(795)
评论(0)
推荐(0)

浙公网安备 33010602011771号