码迷,mamicode.com
首页 >  
搜索关键字:dev/null    ( 790个结果
Linux命令:自动添加用戶
1.自动添加10用戶:#adminuser.sh#!/bin/bash#if[$1==‘--add‘];thenforIin{1..10};doifiduser$I&>/dev/null;thenecho"user$Iexists."elseuseradduser$Iechouser$I|passwd--stdin&>/dev/nullecho"adduser$Ifinished."fidoneelif[$1==‘--del‘];thenforIin{1..10};d..
分类:系统相关   时间:2016-10-22 21:35:32    阅读次数:177
控制虚拟机的脚本
#!/bin/bashcase"$1"instart)virshstart$2;;view)virt-viewer$2&>/dev/null;;poweroff)virshshutdown$2;;stop)virshdestroy$2;;restart)virshreboot$2;;delete)virshundefine$2#删除前端管理不删除存储;;create)virt-install\--name$2\--ram1000\--file/var/lib/libvirt..
分类:其他好文   时间:2016-10-20 01:07:29    阅读次数:140
笔记7(虚拟机管理脚本)
#!bin/bashcase"$1"instart)echostart$2...virshstart$2&>/dev/null;;poweroff)echopoweroff$2...virshdestroy$2&>/dev/null;;reboot)echoreboot$2...virshdestroy$2&>/dev/nullvirshstart$2&>/dev/null;;view)echoview$2...virt-viewer$2&>..
分类:其他好文   时间:2016-10-20 01:01:30    阅读次数:137
虚拟机脚本
#!/bin/bashcase$1inpoweroff)virshdestroy$2&>/dev/null&;;start)virshstart$2&>/dev/null&virt-viewer$2&>/dev/null;;reboot)virshdestory$2&>/dev/null&virshstart$2&>/dev/null&virt-viewer$2&>/dev/null;;crea..
分类:其他好文   时间:2016-10-20 00:56:21    阅读次数:162
用case语句建立一个shell(功能是打开,关闭,重置,显示虚拟机)
用case语句建立一个shell(功能是打开,关闭,重置,显示虚拟机)#!/bin/bashcase"$1"instart)/*当关键字为start时,执行打开虚拟机$2的语句echostart$2...virshstart$2&>/dev/null;;poweroff)/*当关键字为poweroff时,执行强制关闭虚拟机$2的语句echopoweroff$2...virs..
分类:系统相关   时间:2016-10-18 23:47:07    阅读次数:396
Linux虚拟机脚本
#!/bin/bashcase"$1"instart)virshstarthello/开启虚拟机holle;;poweroff)virshdestroyhello/关闭虚拟机holle;;reboot)virshdestroyhello/关闭虚拟机virshstarthello/开启虚拟机virt-viewerhello/显示虚拟机;;teset)echopoweroffhellovirshdestroyhello&>/dev/null/关闭..
分类:系统相关   时间:2016-10-18 23:18:33    阅读次数:176
shell while
第一种startup(){IFS=:whileread-u3IPDIRdossh$IP"sh$DIR/startup_yulong.sh&>/dev/null&"echo"开服执行位置$IP:$DIR"done3<$SCP_FILE
分类:系统相关   时间:2016-10-11 01:04:01    阅读次数:230
Linux下磁盘监控脚本
九月份偷了下懒,补上一篇注释:shell脚本,需要fio工具,实时监控磁盘的读写性能#!/bin/bash DATE=$(date+%m-%d) IOSTATLOG=/var/log/iostat${DATE}.log FIOLOG=/var/log/fio${DATE}.log /bin/ps-ef|grep"iostat-dk5"|grep-vgrep>/dev/null if[$?==0] then echo"Diskmoni..
分类:系统相关   时间:2016-10-10 02:13:57    阅读次数:284
crontab定时任务
crontab定时任务生产应用问题10箴言:1.crond服务必须开启2.定时任务要用绝对路径3.脚本权限问题加/bin/sh4.时间变量问题用反斜线\%转义,最好用脚本5.>/dev/null 2>&1 问题(1>/dev/null 2>/dev/null,,,&>/dev/null)6.定时任务 ...
分类:其他好文   时间:2016-10-10 01:29:58    阅读次数:129
判断用户是否存在,类型是否为管理员
输入一个用户名,判断该用户是admin用户或者普通用户由于管理员用户id是1-500,而普通用户是501以上[root@localhost~]#vim/tmp/uidex.sh #!/bin/bash username=$1 if["$username"=""];then echo"Pleaseinputausername" exit1 fi ifid$username&>/dev/null;then useri..
分类:其他好文   时间:2016-10-08 02:58:38    阅读次数:182
790条   上一页 1 ... 47 48 49 50 51 ... 79 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!