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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rcmd help needed

Status
Not open for further replies.

nogs

Technical User
Aug 3, 2001
89
GB
Can Anyone help?
I am trying to copy a directory to remote sites, this is how I have done it;
rcp $1/avirus.tgz $SITE:$2/avirus.tgz

Which copies the files across fine, what I want to then do is uncompress the file on the remote site, here is the command Im using;

rcmd $SITE "(/appl/bin/gtar -zxvf /u/shared/a_v/avirus.tgz) && echo '100'"`
if [ "$res1" = "100" ] ; then
rcmd $SITE mv $2/avirus $2/update
if [ $? -eq 0 ] ; then
rcmd $SITE chmod 666 $2/update/*
if [ $? -eq 0 ] ; then
echo "`date`: $0: copied $1/avirus.tgz to $SITE:$2."

Does anyone know of a better way of rcpying dirs to remote sites
 
you can also use:

rcp -pr /dir_name remote_host:/dir_name

which will copy the directory and all files/subdirectories under it keeping modification times and modes (-p flag). Regards,
Chuck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top