<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2745.2800" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Here's my rsync script, kind of a quick write so it
could be better.. One thing some of you might like is that the script
checks to make sure that the process is actually running if the pid file
exists. If the pid file exists but the process doesnt, it clears the pid
and continues...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Note: the script has be to run as root to write the
pid, other wise you'll need to make a dir in /var/run and chown that dir, chown
it to your user and edit the script to use that dir...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>--------------[CODE]----------------</FONT></DIV>
<DIV><FONT face=Arial
size=2>#!/bin/sh<BR>RSYNC="/usr/bin/rsync"<BR>RSYNC_OPTS="-aHv --delete
--bwlimit=512 "</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>if [ -f "/var/run/mirror.pid" ];
then<BR> RUNPID=`cat /var/run/mirror.pid`<BR> if ps -p
$RUNPID; then<BR> echo "Mirror is already
running..."<BR> exit 1<BR>
else<BR> echo "Mirror pid found but process dead,
cleaning up"<BR> rm -f
/var/run/mirror.pid<BR> fi<BR>else<BR> echo "No Mirror
Process Detected"<BR>fi<BR>echo $$ > /var/run/mirror.pid</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>echo -n "Mirror Started at
"<BR>date</FONT></DIV><FONT face=Arial size=2>
<DIV><BR>#CentOS Mirror<BR>$RSYNC $RSYNC_OPTS
rsync://mirror.centos.org/cAos/centos/ /data/mirrors/centos/</DIV>
<DIV> </DIV>
<DIV>echo -n "Mirror Ended at "<BR>date<BR>rm -f
/var/run/mirror.pid<BR>----------------------------------------------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><BR>Best Regards,</DIV>
<DIV> </DIV>
<DIV>Shaun Reitan</FONT></DIV></FONT></DIV><FONT face=Arial size=2>
<DIV><BR>Best Regards,</DIV>
<DIV> </DIV>
<DIV>Shaun Reitan<BR>Account Specialist<BR><A
href="http://www.NDCHost.com">www.NDCHost.com</A><BR><A
href="http://www.cPlicensing.net">www.cPlicensing.net</A><BR></FONT></DIV></BODY></HTML>