Hi Listers,

I hope this posting qualifies for your acceptance.
I'm working on a Korn shell script to using rsync to synchronize several Sun
hosts running Solaris 2.7.
Below is the error message that I get. I'm not sure if there is a log file
that can provide more information, but I checked several possibilities
including
- the rsync configuration on both source and destination
- the .rhosts (rsh) configuration on both source and destination
- the backup directory on destination
BTW, does rsync create the backup directory automatically or do I have to
create it in my script before the call to rsync.
- file and directory locations and permissions, etc

bbanksig{opsi}/usr/local/shells/sync>time ./syncgnt.sh bbanksp
24-January-2001 14:07:33
checking if bbanksp is available...
machine is up!
DESTMACH=bbanksp
Password:
Failed to exec remsh : No such file or directory

real    0m15.57s
user    0m0.18s
sys     0m0.45s
bbanksig{opsi}/usr/local/shells/sync>

I'll also include the script that calls rsync below:

if (( $# < 1))
then
echo ""
echo "No destination hostnames provided!"
exit 1
fi


error_handle()
{
 error_code=`echo $?`

 if [ $error_code = 0 ]
    then
       echo ":machine is up!"
       return
    else
       if [ $error_code != 0 ]
          then
            echo ":machine is not available!"
            echo ":rsync cancelled for this machine!"
            exit 1
       fi
 fi
}

rsync_func()
{
/usr/local/bin/sudo /usr/local/bin/rsync \
--rsync-path=/usr/local/bin/rsync \
--verbose \
--verbose \
--archive \
--partial \
--progress \
--stats \
--force \
--compress \
--delete \
--backup \
--backup-dir=/rsyncbups/$(/usr/bin/date +%Y%m%d-%H%M%S) \
$SOURCEDIR $DESTMACH:$PATH
}

#--backup-dir=/rsyncbups/`echo $(/usr/bin/date +%Y%m%d-%H%M%S)` \
#sudo rsh $DESTMACH "chown -R $OWNER:bank $PATH"
#sudo rsh $DESTMACH "chmod -R 666 $PATH"

echo $(date "+%d-%B-%Y %H:%M:%S")
echo "checking if $1 is available..."

SOURCEDIR=$SXXIGNT

alive=$(ping $1 ; error_handle)
#status=`echo $alive | cut -d: -f2 > /dev/null 2>&1`
status=`echo $alive | cut -d: -f2`
DESTMACH="$1"

if [ "$status" != "machine is up!" ]
then
echo $status
#echo $alive | cut -d: -f2
echo "rsync cancelled for this machine!"
fi

if [ "$status" = "machine is up!" ]
then
#echo $alive | cut -d: -f2
echo $status
if [ $DESTMACH = "bbankmain" ]
then
echo DESTMACH=$1
sudo rsh $DESTMACH "mkdir rsyncbups/$(/usr/bin/date +%Y%m%d-%H%M%S)"
PATH=/sxxi/bz
rsync_func
fi
if [ $DESTMACH = "bbanksp" ]
then
echo DESTMACH=$1
sudo rsh $DESTMACH "mkdir rsyncbups/$(/usr/bin/date +%Y%m%d-%H%M%S)"
PATH=/sxxi
rsync_func
fi
fi

Thanks in advance for your time.
Regards,

Denmark W.


Reply via email to