Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple rcp script

Status
Not open for further replies.

ruzwan

Technical User
Jul 3, 2003
6
DE
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top