免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: alex3714
打印 上一主题 下一主题

免费帮忙写脚本,请提供需求…… [复制链接]

论坛徽章:
1
2015年迎新春徽章
日期:2015-03-04 09:56:11
81 [报告]
发表于 2011-04-09 17:37 |只看该作者
樓主趕緊創業或是出國。

论坛徽章:
0
82 [报告]
发表于 2011-04-09 18:53 |只看该作者
回复 1# alex3714


    楼主  能给个Q吗?

   希望以后遇到问题能向你请教。。

   .....

论坛徽章:
0
83 [报告]
发表于 2011-04-09 22:48 |只看该作者
帮我写个脚本吧 谢谢。 检测系统的squid服务有无启动 如果没有的话启动 源码编译 的 安装在/usr/local/squid下

论坛徽章:
3
处女座
日期:2014-11-05 11:02:4315-16赛季CBA联赛之四川
日期:2015-12-10 14:37:4015-16赛季CBA联赛之天津
日期:2017-09-08 18:39:34
84 [报告]
发表于 2011-04-10 00:51 |只看该作者
LZ可以把邮箱、qq报出来,有空找你聊聊,多向你学习学习

论坛徽章:
0
85 [报告]
发表于 2011-04-10 12:42 |只看该作者
楼主厉害,向往之!

论坛徽章:
0
86 [报告]
发表于 2011-04-10 19:34 |只看该作者
楼主这个想法挺不错阿~~

有问题的提问题,有想法的提想法,大家共同探讨,太不错了。

我也想找点不同问题来锻炼自己阿。这里要借点楼主的光找点问题玩了哈哈。

论坛徽章:
0
87 [报告]
发表于 2011-04-11 09:53 |只看该作者
本帖最后由 alex3714 于 2011-04-11 09:54 编辑
帮我写个脚本吧 谢谢。 检测系统的squid服务有无启动 如果没有的话启动 源码编译 的 安装在/usr/local/squi ...
daocaoren0311 发表于 2011-04-09 22:48

请参考以下脚本,实现是同样的功能……
#!/bin/bash

Log_Dir=/root/script
Process=rds
IP_Addr=`/sbin/ifconfig|grep "inet addr"| awk  'NR==1{ print $2}'`
P_Num=$(ps -ef|grep '\brds\b' |grep -v grep|grep -v process-monitor| awk '{print $2}'|wc -l)
echo -e "\n\n The $Process process on server $IP_Addr has been restarted ......\n" > $Log_Dir/rds_process.log
echo -e "\n\n The $Process process on server $IP_Addr has been found dead ,I have tried to restart it but failed ,please look at the $Process 's log to find
the reason .....\n" > $Log_Dir/rds_process.log2
Mail_subject="$Process has been restarted!"
Mail_content=`cat $Log_Dir/rds_process.log`
Mail_subject2="$Process is Down!!!"
Mail_content2=`cat $Log_Dir/rds_process.log2`
if [ $P_Num -lt 2 ];then
        su - rdsprod -c "sh /RdsProd/rds/bin/crontabNohupRDS.sh"
        sleep 5
        P_Num=$(ps -ef|grep '\brds\b' |grep -v grep|grep -v process-monitor| awk '{print $2}'|wc -l)
        if [ $P_Num -lt 2 ];then
                /opt/java_64/jdk1.6.0_17/bin/java  -classpath /fmnp/soft/sms/mailandsms.jar com.cicc.data.SendMessage ibf "$IP_Addr : $Mail_subject2" "$Mail_
content2"
                mail lijie2@cicc.com.cn,wanzy@cicc.com.cn,xuebiao@cicc.com.cn,qianqm@cicc.com.cn -s  "$IP_Addr : $Mail_subject2"  <  $Log_Dir/rds_process.log
2
        #       mail lijie2@cicc.com.cn -s  "$IP_Addr : $Mail_subject2"  <  $Log_Dir/rds_process.log2
        else
                /opt/java_64/jdk1.6.0_17/bin/java  -classpath /fmnp/soft/sms/mailandsms.jar com.cicc.data.SendMessage ibf "$IP_Addr : $Mail_subject" "$Mail_c
ontent"
                mail liji2@cic.com.cn,nzy@cic.com.cn -s  "$IP_Addr : $Mail_subject"  <  $Log_Dir/rds_process.log
        #       mail lijie2@cicc.com.cn -s  "$IP_Addr : $Mail_subject"  <  $Log_Dir/rds_process.log
        fi
else
        echo -e "The monitor script was running at *******: `date +%F-%H:%M`" >> /var/log/process-monitor.log
#       su - rdsprod -c "mail lijie2@cicc.com.cn -s  "$IP_Addr : $Mail_subject"  <  $Log_Dir/rds_process.log"
        exit
fi

#rm -rf $Log_Dir/rds_process.log

echo -e "The monitor script was running at *******: `date +%F-%H:%M`" >> /var/log/process-monitor.log

论坛徽章:
0
88 [报告]
发表于 2011-04-11 09:56 |只看该作者
回复 83# yangdongit


    317828332

论坛徽章:
0
89 [报告]
发表于 2011-04-11 10:24 |只看该作者
真的没有事的话!帮忙写个linux、unix下批量查询域名的shell  或其他脚本!谢谢

论坛徽章:
0
90 [报告]
发表于 2011-04-11 10:33 |只看该作者
没见过楼主写的东西,我也没有写过unix的东西,但是我现在需要写给脚本,就是一般的可执行文件就行,不知道执行文件怎么写,我想把写好的perl代码放在执行文件里面执行,就像windows里面的bat文件一样,楼主帮帮忙吧,谢谢啦。{:3_201:}
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP