lsyncの構築、説明は↓
#!/bin/bash # # lsyncd # # chkconfig: - 99 20 # description: lsyncd auto start script start() { IFS= for i in `cat /etc/lsyncd.conf` do src=`echo $i|awk '{print $1}'` dest=`echo $i|awk '{print $3}'` remort=`echo $i|awk '{print $2}'` /usr/local/bin/lsyncd $src $remort::$dest/ done } stop() { /bin/kill -9 `/sbin/pidof lsyncd` until [ -z $(/sbin/pidof lsyncd) ]; do :; done } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; status) pid=`pidof lsyncd` if [ $? -eq 0 ]; then echo "lsyncd (pid $pid) is running..." else echo "lsyncd is not running" fi ;; *) echo "Usage: lsyncd {start|stop|restart|status}" exit 1 esac exit $? TIPS: |