sftp output is different when running manually/script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sftp output is different when running manually/script
# 1  
Old 06-18-2010
sftp output is different when running manually/script

When I manually sftp a file to a remote server I get the following output on the screen;

Uploading filename to /inbound/xxxxxxx_Folder_1/filename

filename 100% 50 0.1KB/s 00:00

When I run the commands from within a shell script I do not get the "filename 100% 50 0.1KB/s 00:00" information in my logfile. This is valuble information, % transfered and bytes transfered.

Here is the command I am running from within my shell script:

sftp -vv -b $SFTPJOB -oIdentityFile=$KEYPATH/$KEYFILE `/bin/cat $KEYPATH/$CUSTOMER/$AUTHFILE`@$HOST >> $logfile 1>&1

How can I get the output "filename 100% 50 0.1KB/s 00:00" into my logfile when running the command in my shell script.


Moderator's Comments:
Mod Comment Double post. Continue here
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with running script at sftp

Hello All, I am trying to run a sftp batch script (.conf) file from a shell script. I wanted to remove a file from sftp if it exists else it should ignore removing and continue with other commands in .conf file. I am not able to put logic in .conf file.Any idea how that can be achieved. ... (2 Replies)
Discussion started by: sp92
2 Replies

2. Shell Programming and Scripting

Why my git command has no output in crontab but works well run this script manually?

cat /home/lyang001/update.sh #!/bin/sh #shopt -s expand_aliases HOME_DIR=/home/lyang001/updates UPDATE_MAIL=${HOME_DIR}/updates.mail rm $UPDATE_MAIL -rf cd $HOME_DIR/wr-kernel git log --no-merges --since="20 day ago" --name-status --pretty=format:"%an %h %s %cd" origin/WRLINUX_5_0_1_HEAD >>... (2 Replies)
Discussion started by: yanglei_fage
2 Replies

3. Shell Programming and Scripting

Output differs when run manually and when cron job executes it

I get a different output when i manually run the .sh script and when it is run by a cron job. Please help me .. TMP1="/lhome/bbuser/script/wslog/sar.t1" TMP2="/lhome/bbuser/script/wslog/sar.t2" TMP3="/lhome/bbuser/script/wslog/sar.t3" OUTPUT="/lhome/bbuser/script/wslog/sar.out"... (8 Replies)
Discussion started by: nithinankam
8 Replies

4. Shell Programming and Scripting

Part of the Shell script is not running via crontab, runs fine manually

Hello Team, As a part of my job we have made a script to automate a service to restart frequently. Script having two functions when executing it's should find the existing service and kill it, then start the same service . Verified the script it's working fine when executing... (18 Replies)
Discussion started by: gowthamakanthan
18 Replies

5. Shell Programming and Scripting

cronjob not running but runs manually

hello, i recently switched to a new ec2 box and transferred the cronjobs from the old box. For some reason one of the scripts won't work but it runs manually from the command line. I've read from previous threads it might be an environment issue but I added a line with the path to the script... (2 Replies)
Discussion started by: lencholamas
2 Replies

6. Shell Programming and Scripting

Getting issue while running it from cron while manually working fine

Hello, I am working one one script where I am using the below code which is using to connect with MKS client when I run my script manually it works effiecently i.e. it connects with MKS client but when I run it from CRON it doesn't connect. 1)Can some one tell when it is running from cron... (1 Reply)
Discussion started by: anuragpgtgerman
1 Replies

7. Shell Programming and Scripting

Running a script in system() call and want the script's output

Hi All, I have a script(sample.sh) displaying the output of "dd" command. Now i am using this script in system() call as, system("sh sample.sh") in an application file. I want the output of system("sh sample.sh") in the application file itself. How can i get it? Many thnaks.... (9 Replies)
Discussion started by: amio
9 Replies

8. UNIX for Dummies Questions & Answers

sftp output is different when running manually/script

When I manually run a sftp to a remote server I receive the following output on he screen; Uploading filename to /inbound/xxxxxxx_Folder_1/filename filename 100% 50 0.1KB/s ... (1 Reply)
Discussion started by: rugggy
1 Replies

9. UNIX for Dummies Questions & Answers

Running script on SFTP server, RMDIR and RM with wildcards

Im going insane trying to figure out what i consider a basic command on an SFTP server... Im trying to download all files from a directory *done* then remove all the files (and sometimes folders that contain files) i have downloaded on the remote directory... the command i would normally... (2 Replies)
Discussion started by: mokachoka
2 Replies

10. Solaris

SFTP errorcode 1 when run on cron but runs manually

I am trying to run a sript on cron to SFTP data to a company. Private and public keys are set up. When I run this manully it works fine, however it was failing when run on cron. I have narrowed down the problem - it fails at the code that says if the error code is 0 then continue . . . I... (2 Replies)
Discussion started by: Heidi.Ebbs
2 Replies
Login or Register to Ask a Question