Jan 30, 2008 #1 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.
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.
Jan 30, 2008 #2 khalidaaa Technical User Joined Jan 19, 2006 Messages 2,323 Location BH 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 Upvote 0 Downvote
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
Jan 31, 2008 Thread starter #3 nimrodman MIS Joined Nov 22, 2005 Messages 43 Location US Thanks, that will do. Upvote 0 Downvote
Jan 31, 2008 #4 ogniemi Technical User Joined Nov 7, 2003 Messages 1,041 Location PL rsync+ssh is more reliable for such copying I think... eg.: rsync -avz -e ssh remoteuser@remotehost:/remote/dir /this/dir/ Upvote 0 Downvote
rsync+ssh is more reliable for such copying I think... eg.: rsync -avz -e ssh remoteuser@remotehost:/remote/dir /this/dir/