rsync启动脚本
rsync启动脚本
01
#!/bin/bash www.ahlinux.com
02
#
03
# rsyncd This shell script takes care of starting and stopping
04
# standalone rsync.
05
#
06
# chkconfig: - 99 50
07
# description: rsync is a file transport daemon
08
# processname: rsync
09
# config: /etc/rsyncd.conf
10
11
# Source function library
12
. /etc/rc.d/init.d/functions
13
14
RETVAL=0
15
rsync="/usr/local/bin/rsync"
16
prog="rsync"
17
CFILE="/etc/rsyncd.conf"
18
19
start() {
20
# Start daemons.
21
[ -x $rsync ] || \
22
{ echo "FATAL: No such programme";exit 4; }
23
[ -f $CFILE ] || \
24
{ echo "FATAL: config file does not exist";exit 6; }
25
echo -n $"Starting $prog: "
26
daemon $rsync --daemon --config=$CFILE
27
RETVAL=$?
28
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
29
echo
30
return $RETVAL
31
}
32
33
stop() {
34
# Stop daemons.
35
echo -n $"Stopping $prog: "
36
killproc $prog -QUIT
37
RETVAL=$?
38
echo
39
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
40
return $RETVAL
41
}
42
43
# call the function we defined
44
case "$1" in
45
start)
46
start
47
;;
48
stop)
49
stop
50
;;
51
restart|reload)
52
stop
53
start
54
RETVAL=$?
55
;;
56
status)
57
status $prog
58
RETVAL=$?
59
;;
60
*)
61
echo $"Usage: $0 {start|stop|restart|reload|status}"
62
exit 2
63
esac
64
65
exit $RETVAL
- 本文来自:Linux学习网
rsync启动脚本的更多相关文章
- 开发rsync启动脚本2
使用函数更加规范的开发rsync启动脚本 #!/bin/bash #chkconfig: #description: create by vincen . /etc/init.d/functions ...
- 开发rsync启动脚本
rsync rsync是类unix系统下的数据镜像备份工具——remote sync.一款快速增量备份工具 Remote Sync,远程同步 支持本地复制,或者与其他SSH.rsync主机同步. ...
- rsync随机启动脚本
服务端 #!/bin/sh # chkconfig: # description: Saves and restores system entropy pool for \ #create by xi ...
- 15:开发Rsync服务启动脚本案例
[root@m01 ~]# rsn_count="ps -ef|grep 'rsync --d[a]emon'|wc -l" [root@m01 ~]# echo ${rsn_co ...
- linux shell 之尝试编写 企业级 启动脚本
企业Shell面试题10:开发企业级MySQL启动脚本 说明: MySQL启动命令为: 1 /bin/sh mysqld_safe --pid-file=$mysqld_pid_file_path 2 ...
- Spark学习之路 (十五)SparkCore的源码解读(一)启动脚本
一.启动脚本分析 独立部署模式下,主要由master和slaves组成,master可以利用zk实现高可用性,其driver,work,app等信息可以持久化到zk上:slaves由一台至多台主机构成 ...
- logstash服务启动脚本
logstash服务启动脚本 最近在弄ELK,发现logstash没有sysv类型的服务启动脚本,于是按照网上一个老外提供的模板自己进行修改 #添加用户 useradd logstash -M -s ...
- 改进uwsgi启动脚本,使其支持多个独立配置文件
最近在研究flask,在架设运行环境的时候犯了难.因为我想把每个独立的应用像NGINX处理多个网站那样,每个应用单独一个配置文件.而网上流传的uwsgi启动脚本都只支持单个配置文件.虽然有文章说可以把 ...
- linux nginx 启动脚本
linux nginx 启动脚本 [root@webtest76 ~]# vi /etc/init.d/nginx #!/bin/bash # nginx Startup script for the ...
随机推荐
- java多线程的四种实现方式
主要有四种:继承Thread类.实现Runnable接口.实现Callable接口通过FutureTask包装器来创建Thread线程.使用ExecutorService.Callable.Futur ...
- win10 去掉资源管理器左侧的Creative Cloud Files
open regedit 依次打开HKEY_CLASSES_ROOT\CLSID\{0E270DAA-1BE6-48F2-AC49-95A54E35F3C4} 双击{0E270DAA-1BE6-48F ...
- [CF1105E] Helping Hiaset
问题描述 你在某社交网站上面注册了一个新账号,这个账号有\(n(n\leq 10^5)\)次记录.要么就是你更改过一次ID,要么就是一个ID为\(s(|s|\leq 40)\)的朋友访问过你的空间. ...
- 【leetcode】Department Top Three Salaries
The Employee table holds all employees. Every employee has an Id, and there is also a column for the ...
- zTree 节点展开
var treeObj = $("#treeDemo"); $.fn.zTree.init(treeObj, setting, Znode1); zTree_Menu = $.fn ...
- KMP模版 && KMP求子串在主串出现的次数模版
求取出现的次数 : #include<bits/stdc++.h> ; char mo[maxn], str[maxn];///mo为模式串.str为主串 int next[maxn]; ...
- 二叉排序树(Binary Sort Tree)
1.定义 二叉排序树(Binary Sort Tree)又称二叉查找(搜索)树(Binary Search Tree).其定义为:二叉排序树或者是空树,或者是满足如下性质的二叉树: ① 若它的左子树 ...
- 洛谷 P1546 最短网络 Agri-Net x
题目背景 农民约翰被选为他们镇的镇长!他其中一个竞选承诺就是在镇上建立起互联网,并连接到所有的农场.当然,他需要你的帮助. 题目描述 约翰已经给他的农场安排了一条高速的网络线路,他想把这条线路共享给其 ...
- mybatis resultType=map时,value为null时返回结果没有对应的key
mybatis.xml 配置文件设置 <configuration> <settings> <!-- 在null时也调用 setter,适应于返回Map,3.2版本以上可 ...
- 浏览器使用小tip
谷歌浏览器截取长图 很多网页长图单个页面截不下来,那么需要如何解决? 首先,在谷歌浏览器chrome中打开需要截图的网页,等待需要截图的网页打开完毕,然后按F12 打开开发者工具,然后按组合键 Ctr ...