Does anyone have any idea of how I can make a multiple rcp script more robust in terms of ensuring complete files are copied. It uses a dedicated backup network and the directories being copied are quite large hence why the rcp's are run in background as opposed to being run sequentially. An alternative would be to run a few smaller scripts and use $? to see if the rcp worked and have a wrapper script to check the existance of tokens but there must be a better way to do this.
REMHOST=TestServer
WHERE2COPY=/tmp/where2copy
cat $WHERE2COPY | read TOKEN
if [ $TOKEN -eq 1 ]
then
FILESYS=primary
else
FILESYS=secondary
fi
rcp -pr /user1/A $REMHOST:/$FILESYS/user1/ &
rcp -pr /user2/B $REMOST:/$FILESYS/user2 &
rcp -pr /user3/C $REMHOST:/$FILESYS/user3 &
rcp -pr /user4/D $REMOST:/$FILESYS/user4 &
etc.
It should finish by determining which FILESYS it used for this copy and then change it the next time round.
Thanks
REMHOST=TestServer
WHERE2COPY=/tmp/where2copy
cat $WHERE2COPY | read TOKEN
if [ $TOKEN -eq 1 ]
then
FILESYS=primary
else
FILESYS=secondary
fi
rcp -pr /user1/A $REMHOST:/$FILESYS/user1/ &
rcp -pr /user2/B $REMOST:/$FILESYS/user2 &
rcp -pr /user3/C $REMHOST:/$FILESYS/user3 &
rcp -pr /user4/D $REMOST:/$FILESYS/user4 &
etc.
It should finish by determining which FILESYS it used for this copy and then change it the next time round.
Thanks