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 ...
随机推荐
- 010-SaltStack及SaltStack Web UI安装部署
saltstack web uiweb平台界面 saltapi项目主页:http://salt-api.readthedocs.org/en/latest/ halite 项目主页:https://g ...
- Linux_GDB调试学习笔记
点击直接跳转 第01课:调试信息与调试原理 第02课:启动GDB调试 第03课:GDB常用的调试命令概览 第04课:GDB常用命令详解(上) 第05课:GDB常用命令详解(中) 第06课:GDB 常用 ...
- 4.3 jmu-Java-03面向对象-06-继承覆盖综合练习-Person、Student、Employee、Company (20 分)中的一些问题
1.Employee类的equals 由于题目要求//首先调用父类的equals方法,如果返回true.再比较company与salary.//比较salary属性时,使用DecimalFormat ...
- JS 转化为String的三种方法
// 1. toString() var num = 8; var numString = num.toString(); console.log(numString); var result = t ...
- shell中条件判断if中的-z到-d
shell中条件判断if中的-z到-d的意思 [ -a FILE ] 如果 FILE 存在则为真. [ -b FILE ] 如果 FILE 存在且是一个块特殊文件则为真.[ -c FILE ] 如果 ...
- Android APK 手动签名
首先,如果没有签名密钥,先生成密钥: keytool -genkey -alias android.keystore -keyalg RSA -validity 20000 -keystore and ...
- 清空DataGridView
DataTable dt = (DataTable)dgv.DataSource; dt.Rows.Clear(); dgv.DataSource = dt;
- 关于system.timer的使用
private System.Timers.Timer _timer = null; if (_timer == null) { _timer = new System.Timers.Timer(); ...
- MAC使用终端DISKUTIL命令给U盘分区(解决window优盘只有200M)
1.先使用diskutil list命令查看U盘代号 2.然后用下面的命令把它格式化: sudo diskutil eraseDisk FAT32 USB_NAME MBRFormat /dev/di ...
- Machine Learn in Action(K-近邻算法)
使用K-近邻算法将某点[0.6, 0.6]划分到某个类(A, B)中. from numpy import * import operator def classify0(inX, dataSet, ...