wd and cc

— Happy every day

rsync脚本的一个例子

Posted at — May 9, 2006
SYNCLOGFILE="/var/log/rsync-201.log"
SYNCLOCKFILE="/var/lock/rsync-201.lock"

if [[ -f $SYNCLOCKFILE ]]; then
  # lock file already present, bail
  exit 1
fi

echo -n ">>> Sync log for " >> $SYNCLOGFILE
date >> $SYNCLOGFILE

touch $SYNCLOCKFILE
rsync -vzrtopg  --delete 192.168.0.201::www /backup  >> $SYNCLOGFILE 2>&1
rm -f $SYNCLOCKFILE

comments powered by Disqus