Does SCP return an error code for network issues


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Does SCP return an error code for network issues
# 1  
Old 06-26-2012
Does SCP return an error code for network issues

Hello everyone,
In a script, I am using SCP to copy huge file to another host.

scp -qrp hugefile.txt /opt/perf05/tmp

However, we have noticed that this file is not being copied. I am suspecting this was because we are losing connection while copying this huge file across network. Does scp command return any error code in case of such network disconnect or is there any other way of debugging this to find out what exactly causes this failed copy. Thanks in advance.

-Steve
# 2  
Old 06-26-2012
Depends on your version of scp. Some proprietary versions don't return an error code.

Check for output on standard error.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Error re-direction and Return code

Hi, I have a shell script which executes some sql. When the shell script executes the sql's logging is shown on the console. I need to grep some data from this output shown on console. So I do the following hive -f load.adj.hql 2>&1 | tee c.txt echo $? A=`grep num_rows c.txt` $? will... (1 Reply)
Discussion started by: wahi80
1 Replies

2. Red Hat

Network becomes slow and return fast only after restart network

Hi, I have 2 machines in production environment: 1. redhat machine for application 2. DB machine (oracle) The application doing a lot of small read&writes from and to the DB machine. The problem is that after some few hours the network from the application to the DB becomes very slow and... (4 Replies)
Discussion started by: moshesa
4 Replies

3. Shell Programming and Scripting

Greping return code error

Hi folks, I am running below code which is giving me output "httpd (no pid file) not running", how can i grep this code in shell script. I have tried below code but it is not giving me error in echoing. ./webserver stop if echo " Everything is OK" else echo "Error code $0... (4 Replies)
Discussion started by: learnbash
4 Replies

4. Shell Programming and Scripting

SFTP return Error Code 126

Hi, We are getting the following error code while connection remote server using sftp command. sftp user@serrver Warning: child process (/opt/ssh2/bin/ssh2) exited with code 126. pls Advise. (2 Replies)
Discussion started by: koti_rama
2 Replies

5. Cybersecurity

automatic SCP transfers issues

Hi, I'm trying to set up scp but it isn't as nice as WinSCP. My requirement is to transfer a file from one machine to another with scp. This would run in a .ksh so it would need to avoid prompts (password/are you sure). First I tried this with v2: SSH with Keys HOWTO: SSH with Keys in a console... (1 Reply)
Discussion started by: Dird
1 Replies

6. Shell Programming and Scripting

Getting error return code

I need to try and get the error return code from the tar command when being used as follows: tar tvf tarfile 2>logfile | tee -f outputfile ErrorStat="$?" I would like to save the error return code from the tar command in a variable, howver, the example above it is saving the 'tee' error... (7 Replies)
Discussion started by: nck
7 Replies

7. Shell Programming and Scripting

Verify scp return status

Hi all below is a snippet of my perl codesystem ("scp -pq $dest_file $path");How i can i trap the return status? ie if the scp fails how can i know ? (2 Replies)
Discussion started by: new2ss
2 Replies

8. Shell Programming and Scripting

how to get error return code

I have a unix AIX script that ftps some files (mput, mget). How can I check (in the script) to see if the ftp failed? After the ftp I move the files out of the directory but do not want to move files that have not been sent. The script will run as a cron job. (2 Replies)
Discussion started by: rayg50
2 Replies

9. UNIX for Dummies Questions & Answers

scp transmits ok but random return code

Appreciate your thoughts....I m very new to this. Anyone here have the similar experience and work around. Thanks. Use scp to send a file from HP-UX to SUN box successfully but return code randomly being generated. The majority of time reports 1 (meaning not ok) and sometime 0 (OK). When scp... (0 Replies)
Discussion started by: huiraym
0 Replies
Login or Register to Ask a Question