SCP fails sometimes


 
Thread Tools Search this Thread
Operating Systems AIX SCP fails sometimes
# 8  
Old 07-03-2007
Try and run this to get the stdout to go to the log file:
Code:
Assuming:
scp_cmd="/usr/local/bin/scp -v $Target_file remoteservername:$Copy_directory"
Then:
$scp_cmd 2>&1 > /tmp/logfile.tmp 2>&1

After it runs, you should have something in the log file. Also, if you run the scp manually, it returns without any errors?
# 9  
Old 07-17-2007
Yea man... I got the problem. Its like this...Iam opening an IP address and echoing the username and password for getting access to that machine. And from that machine only i am SCPing the file. This is because my username don't have the privilege to do SCP from my system. At this time when I echo the username and password if there is some problem in the network and the connection gets delayed ,then its just echoing username and password there itself.Its not waiting for password prompt.

We got an alternative method. I got another username which have the same privilege in my system. The thing we have to do is just to switch to that user and do the SCP. But the problem here is again the password prompt...i got the user password with us....but i am not able to echo it. There is other method like SUDO and EXPECT. But these things are not available in our system.....This is the scenario....Any hope????

Thanks in advance....

Vipin C
# 10  
Old 07-17-2007
I've never been able to switch from one to another user successfully except for when switching from root. If you get it to work, I'd love to know how but I don't *think* it is possible.
# 11  
Old 07-18-2007
Directly with only Unix script Its not possiblee,I guess... But there are some other options like sudo utility and EXPECT module in Perl.....Iam now checking with these.....But sudo seems unavailable in the system...and since its a secure server they won't allow us to install that too.....iam trying with the EXPECT module....till now, its didn't give good result....anyway i got hope......
will let you know once it succeeds..

Thanks,
Vipin C
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to know why crontab -e fails

more cron.txt 1 * * * * /u/ways.sh 2>&1 >/dev/null bash-4.1$ export EDITOR=vi bash-4.1$ crontab -e <cron.txt Vim: Warning: Input is not from a terminal Vim: Error reading input, exiting... Vim: Finished. The crontab file was not changed. bash-4.1$ echo $? 1 bash-4.1$ uname -a SunOS... (3 Replies)
Discussion started by: mohtashims
3 Replies

2. HP-UX

shl_load fails

Hi, I have written a simple program of 2 lines in C to load a library using SHL_LOAD. It fails with error "/usr/lib/hpux32/dld.so: Unable to find library 'xyz.sl'. Load failure for library , ERRNO = 2" Shlib_PATH,LD_LIBRARY_PATH,PATH,LD_PRELOAD are set correctly and library exists on the... (0 Replies)
Discussion started by: ashwinichavan
0 Replies

3. Red Hat

mkinitrd fails

hi, i´ve been the last 48 hours with this issue.... after clone another system to a new one with lvm, the last step is mkinitrd. i execute it and it finish, but some errors are sent to stderrr. /sbin/mkinitrd: line380: gawk: command not found Traceback (most recent call last) File... (0 Replies)
Discussion started by: pabloli150
0 Replies

4. Programming

realloc() fails

Not sure in which forum to post this. I'm trying here, in Programming. I'm working on a PC with Intel Duo processor & 2GB of ram. OS is Ubuntu 10.04. I'm having problems with a C++ program that makes extensive use of realloc(). It happens that as soon as the overall memory allocated(OS +... (14 Replies)
Discussion started by: mamboknave
14 Replies

5. Programming

What happens when realloc() fails?

Hi, I am seeing varying results about, when realloc() fails in reallocation. Which one is correct out of the below? a) realloc() maintains the original pointer (i.e) the original pointer is left unaltered/untouched but relloc() returns the NULL value. b) original buffer pointer is lost... (3 Replies)
Discussion started by: royalibrahim
3 Replies

6. Shell Programming and Scripting

until loop fails.

i have a script like below, i am trying to print "...." until a background process that was executed before is running,, the below does work and teh loop keeps on printing "..", can someone help where i am wrong. /tmp/test/abc.sh & until do echo "..\c" done abc.sh is the scipt... (8 Replies)
Discussion started by: yesmani
8 Replies

7. UNIX for Dummies Questions & Answers

scp from aix to windows (cygwin) fails

Hi... my problem is that I want to copy one html-file to my windows-box webserver using scp. so far no problem but the destination is in /cygdrive/c/program files/dest and as we all know unix doesnt like spaces in paths. scp html.file user@windowsbox:/cygdrive/c/program... (5 Replies)
Discussion started by: cypher82
5 Replies

8. UNIX for Advanced & Expert Users

make fails...

Hi When im trying to do make --version and make --help in HP-UX it throws error Make: Unknown flag argument -. Stop. a soft link is present in this directory /usr/bin/make and hard link is in /usr/ccs/bin/make what could be the reason can any1 ..please tell me how to solve this... (1 Reply)
Discussion started by: vasanthan
1 Replies

9. UNIX for Dummies Questions & Answers

pkg_add fails

Hi, I have created a package on a 64 bit FreeBSD machine. when i install this (on another 64 bit FreeBSD machine )i get the following error : tar: Skipping pathname containing .. pkg_add: tar extract of /home/vcr/testpackage.tgz failed! pkg_add: unable to extract '/home/vcr/testpackage.tgz'!... (0 Replies)
Discussion started by: HIMANI
0 Replies

10. UNIX for Advanced & Expert Users

at command fails

hi, all the user on my machine can't launch at job anymore. they all got the message "error in message send" each time they launch something using the at command. i tried to empty the job queue but the error message is still there. What can I do ? Thanks (1 Reply)
Discussion started by: a329743
1 Replies
Login or Register to Ask a Question