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

scp

Status
Not open for further replies.

nimrodman

MIS
Nov 22, 2005
43
0
0
US
Does anyone have a scp script with a good error check, I am trying to do a script that can get a directory from one server to the other.
 
You can always use the exsit code out of the scp command!

for example:

Code:
scp node1:/source_dir node2:/destination_dir
if [[ $? -eq 0 ]]
  then
    echo "scp Successful" 
  else
    echo "scp Unsuccessful" 
fi

If this is not what's in your mind then posting your script will help me more in identifying your exact requirement.

Regards,
Khalid
 
rsync+ssh is more reliable for such copying I think...

eg.:

rsync -avz -e ssh remoteuser@remotehost:/remote/dir /this/dir/
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top