ChinaUnix.net
相关文章推荐:

linux 服务脚本

这是在/etc/init.d/中的一个脚本,请问一下,能否使脚本在执行start后自动执行某一段linux命令然后再restart一遍! 脚本文件在附件中,麻烦各位帮忙看一下!

by bgsmgrx - Python - 2013-04-11 09:55:07 阅读(1805) 回复(5)

相关讨论

作者: sixth 出处:赛迪网  阅读提示:首先编写了一个用作服务的程序,功能很简单,每隔1秒钟把当前时间写入一个文件中.... void recordTime() { const char pa[256] = "//home//projects//testService//recordTime"; ofstream fout; fout.open(pa, ios::app); time_t currTime; struct tm *tp; char buf[256]; while(1) { currTime = time(NULL); tp = localtime(&currTim...

by sdccf - Linux文档专区 - 2008-04-29 16:53:17 阅读(647) 回复(0)

小弟在自学linux,6月份要参加一个比赛。现在系统管理还没有看完,卡在了shell脚本这里,实在是感觉头疼。 6月份的比赛很多是关于linux下的服务器搭建与维护。 想问下各位高手,linux服务器搭建与维护用到的shell脚本知识多么?如果不多的话,我想先看下linux服务器搭建,突击下6月份的比赛。 感觉shell脚本linux系统管理还有linux服务器搭建维护是linux的三大块啊! 听听大家的看法吧,先谢谢了

by 450120127 - Linux新手园地 - 2011-04-13 09:57:05 阅读(4013) 回复(16)

#!/bin/bash#ts4.sh clear [color="#ff0000"]#脚本存放路径 PWD="/root/shell/ts" echo `date` [color="#ff0000"]#ip_list 文件是需要检查的服务器和服务器端口 ls $PWD/ip_list 2> /dev/null if [ $? -eq 0 ] then echo "this is file is ture!" NUM=`wc -l $PWD/ip_list | awk '{print $1}'` while read LINE do echo $LINE >$PWD/temp.ip x=`awk '{printf $1}' $PWD/temp.ip` y=`awk '{printf $2}' $PWD/temp.i...

by didonglin - Linux文档专区 - 2009-12-29 12:17:12 阅读(970) 回复(0)

#!/bin/bash #program:Usingtostudythe[if...then...fi]program #dsk2007/10/83:00 #content:Iwillusingthisprogramtoshowyousevices #1.printtheprogram''sworkinyourscreen echo "Now,the service of your linux system will be detect!" echo "The www,ftp,ssh,and sendmail pop3 will be detect!" echo "" #2.www www=`netstat -ntlp | awk '{print $4}' | grep :80$` if [ "$www" != "" ]; then echo $www echo "WWW is runi...

by didonglin - Linux文档专区 - 2009-12-29 12:13:57 阅读(898) 回复(0)

我有多台linux服务器需要维护,每次我都需要远程连接到每天服务器进行相同的操作,随着服务器数量的增加,感觉越来越麻烦,是否可以做一个shell脚本,我只要在一台服务器上执行这个脚本后加命令,就可以把指令发送到所有的服务器上自动执行,但是也不能做key,请高手解说下该如何做,或者做一个2台服务器的脚本让我参考下。

by cjmmm_99 - Shell - 2009-03-03 13:08:04 阅读(4187) 回复(5)

我的应用服务linux9.0+httpd+tomcat+postgres 我如何做一个程序(或脚本)让系统每隔几秒访问数据库和网络情况, 如果有问题,分别通过email和sms通知我。(发短信的程序我有了)。 请各位有经验的朋友帮忙。我会非常感谢。

by fa8898 - Java - 2004-05-31 10:39:11 阅读(914) 回复(0)

本帖最后由 chinaboywg 于 2011-03-24 16:10 编辑 [code]#!/bin/bash #by chinaboyxiaobao #####edit_config function vsftpd_conifg() { sed 's/\#write_enable=YES/write_enable=YES/g' /etc/vsftpd.conf >/etc/vsftpd.conf.tmp mv /etc/vsftpd.conf.tmp /etc/vsftpd.conf sed 's/\#local_enable=YES/local_enable=YES/g' /etc/vsftpd.conf >/etc/vsftpd.conf.tmp mv /etc/vsftpd.conf.tmp /etc/vsftpd....

by chinaboywg - Shell - 2011-03-16 19:02:07 阅读(4560) 回复(8)

ubuntu下的ssh客户端一直没找到象SecureCRT那样好用的工具。用ssh登录,每次都要输入密码,感觉很麻烦,而且因为字符集不相同,一般还有乱码问题,所以参照网上的一些实现自己也通过python来实现了一下。 #1.通过参数自动登录ssh远程服务器 #2.通过配置字符集解决中文乱码问题 #3.解决改变远程窗口默认较小bug,远程窗口同本地窗口大小动态改变未处理 #4.实现2级代理 #5.可以使用sftp登录来传文件(sftp,目前不能...

by uranusllj - Python文档中心 - 2009-06-12 19:03:27 阅读(2140) 回复(0)

#!/bin/bash #program:Usingtostudythe[if...then...fi]program #dsk2007/10/83:00 #content:Iwillusingthisprogramtoshowyousevices #1.printtheprogram''sworkinyourscreen echo "Now,the service of your linux system will be detect!" echo "The www,ftp,ssh,and sendmail pop3 will be detect!" echo "" #2.www www=`netstat -ntlp | awk '{print $4}' | grep :80$` if [ "$www" != "" ];  then echo $www echo "W...

by sjhf - Linux文档专区 - 2009-03-23 11:37:29 阅读(637) 回复(0)

#!/bin/bash#ts4.sh clear [color="#ff0000"]#脚本存放路径PWD="/root/shell/ts" echo `date` [color="#ff0000"]#ip_list 文件是需要检查的服务器和服务器端口ls $PWD/ip_list 2> /dev/null if [ $? -eq 0 ]   then   echo "this is file is ture!"   NUM=`wc -l $PWD/ip_list | awk '{print $1}'`   while read LINE   do   echo $LINE >$PWD/temp.ip   x=`awk '{printf $1...

by sjhf - Linux文档专区 - 2009-03-23 11:37:29 阅读(621) 回复(0)