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 Chriss Miller 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
Joined
Nov 22, 2005
Messages
43
Location
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.

Similar threads

  • Locked
  • Question Question
Replies
5
Views
180
  • Locked
  • Question Question
Replies
12
Views
1K

Part and Inventory Search

Sponsor

Back
Top