scp is not working through sh script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting scp is not working through sh script
# 8  
Old 03-10-2010
specify the full path of scp

something like
Code:
/bin/scp


cheers,
Devaraj Takhellambam
# 9  
Old 03-10-2010
Quote:
Originally Posted by Amit.Sagpariya
The problem is it is not producing any error message.
I doubt that very much. But just in case, replace the line
Code:
scp $COM_DIR/ABC.txt unix.nam.nsroot.net:/home/magna/dum/ABC.txt >> $LOG

with
Code:
scp $COM_DIR/ABC.txt unix.nam.nsroot.net:/home/magna/dum/ABC.txt >> $LOG 2>&1
[ $? -ne 0 ] && echo "Error with SCP: $?" >> $LOG

Make sure you copy them verbatim, as both are new to your script.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

scp command not working

Hi All, I have automated the file transfer process using shell script.I used passwordless SCP to copy the files to my remote server as below. scp -P 2022 -v Test.dat username@Host:destination_folder But the files are not copied to the destination folder.The execution is terminated with... (1 Reply)
Discussion started by: Syruss
1 Replies

2. UNIX for Dummies Questions & Answers

scp command not working

I am trying to copy a file from a remote linux server to my local ubuntu box. I am issuing the following command: scp -v root@remote_server_IP:/test /data The output of the command is : OpenSSH_6.6, OpenSSL 1.0.1f 6 Jan 2014 debug1: Reading configuration data /etc/ssh/ssh_config... (3 Replies)
Discussion started by: Palak Sharma
3 Replies

3. Shell Programming and Scripting

Scp/Rsync transfers stopped working?

Hi all, I have a backup script from my work computer to my home computer for my research for multiple reasons. It's a simple rsync script, with about 5 gigs of data. (Obviously with rsync it doesn't transfer 5 GB every time.). Recently, it has stopped working, scp also doesn't work, it simply... (1 Reply)
Discussion started by: corrado33
1 Replies

4. Shell Programming and Scripting

scp not working in expect script

Hi All, I run the scp command in shell prompt without issue, but when on expect script as below: #!/usr/bin/expect spawn scp /var/spool/sms/failed.tar.gz abc@10.10.12.2:/home/abc expect "abc@10.10.12.2's password: " send "abcfef\r" exit 0 It looks not working at all and the... (3 Replies)
Discussion started by: elingtey
3 Replies

5. Shell Programming and Scripting

Script not working in cron but working fine manually

Help. My script is working fine when executed manually but the cron seems not to catch up the command when registered. The script is as follow: #!/bin/sh for file in file_1.txt file_2.txt file_3.txt do awk '{ print "0" }' $file > tmp.tmp mv tmp.tmp $file done And the cron... (2 Replies)
Discussion started by: jasperux
2 Replies

6. Solaris

SCP not working while SSH works

Dear expert, I have gone through the thread A similar error arising for me , please find the debug logs. I have tried from another server to push a file using scp but not working for me. i am using SunOS SUNW,SPARC-Enterprise machine. Thanks (5 Replies)
Discussion started by: posix
5 Replies

7. UNIX for Dummies Questions & Answers

scp not working because of prompt (AIX, tcsh)

Hello, I have this problem: I have a server to which I ssh, and it has a special prompt request. The prompt is done by a ?prompt command. It is fine with SSH, since the prompt I guess gets some input, but when I use SCP, the copy always fails. So, I was wondering if there is maybe a... (1 Reply)
Discussion started by: lastZenMaster
1 Replies

8. Solaris

ssh and scp not working

Dear All, whenever i try the command ssh , it is giving the below error. ld.so.1: ssh: fatal: relocation error: file /usr/bin/ssh: symbol SUNWcry_installed: referenced symbol not found Killed For SCP also the same error is coming. Pl reply me if you have answers. Rj (4 Replies)
Discussion started by: jegaraman
4 Replies

9. AIX

scp not working while ssh works

I try to transfer a file from a Linux host to an AIX-host via scp, which fails. Logging into the AIX-system from the same Linux-system via ssh works well and i am a bit at a loss where to look. The original setup was with a user account provided via LDAP, but because of the error message (see... (4 Replies)
Discussion started by: bakunin
4 Replies

10. Programming

Controlling a child's stdin/stdout (not working with scp)

All, Ok...so I know I *should* be able to control a process's stdin and stdout from the parent by creating pipes and then dup'ing them in the child. And, this works with all "normal" programs that I've tried. Unfortunately, I want to intercept the stdin/out of the scp application and it seems... (9 Replies)
Discussion started by: DreamWarrior
9 Replies
Login or Register to Ask a Question