Problem in turn verbose on in sftp


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem in turn verbose on in sftp
# 1  
Old 02-15-2013
Question Problem in turn verbose on in sftp

Hi,

I am trying to turn verbose on for sftp but i get message to look lftp options.
Code:
SFTP_LOG=`lftp -u $P_USERID,$P_PSWD sftp://$P_HOSTNAME <<EOF
   cd $P_DEST_DIR
   mput $P_FILE_PREFIX
   bye
   EOF`

The above one works fine but i don't see the debugging details\log details.

I want to capture the log details in SFTP_LOG so that I will know if there has been any issue with the operation.



For FTP, I am able to get complete details...below is one sample one where i able to get all details in FTP_LOG.
Code:
FTP_LOG=`ftp -nv -i $FTPHOST << !
quote user $FTPUSER
quote pass $FTPPWD
cd $FTPDIR
lcd $local_path
quit
!`


Appreciate if anyone can suggest me in what way I can get the above sftp tweeked to get the log details captured.

Last edited by Franklin52; 02-18-2013 at 03:39 AM.. Reason: Please use code tags for data and code samples
# 2  
Old 02-15-2013
# 3  
Old 02-15-2013
I tried but its not working out.

If you have tried it at ur end..can u show me how u did?
# 4  
Old 02-15-2013
What, exactly, did you do, and in what way is it "not working"?
# 5  
Old 02-15-2013
I tried to use cmd:trace option in the lftp as given in the script but I do not get the debugging details captured in SFTL_LOG.
Code:
SFTP_LOG=`lftp -u $P_USERID,$P_PSWD sftp://$P_HOSTNAME set cmd:trace yes <<EOF
cd $P_DEST_DIR
mput $P_FILE_PREFIX
bye
EOF`
 
echo $SFTP_LOG

I see the file is getting transfered but i don't see the log details.

Pls correct me if you see anything wrong.

I just want to have the activity details captured in the SFTP_LOG....just like the FTP_LOG which I shown in the start....

Last edited by Franklin52; 02-18-2013 at 03:40 AM.. Reason: Please use code tags for data and code samples
# 6  
Old 02-15-2013
Quote:
Originally Posted by consat
I see the file is getting transfered but i don't see the log details.

Pls correct me if you see anything wrong.
It's probably printing the log to standard error, not standard output, so the backticks see nothing. Try
Code:
SFTP_LOG=`command parameters 2>&1 <<EOF ...

# 7  
Old 02-15-2013
I tried but still don't see details in $SFTP_LOG.

Code:
SFTP_LOG=`lftp -u $P_USERID,$P_PSWD sftp://$P_HOSTNAME set cmd:trace yes 2>&1 <<EOF
cd $P_DEST_DIR
mput $P_FILE_PREFIX
bye
EOF`

echo $SFTP_LOG


Wrt to file transfer, it works.

Last edited by Franklin52; 02-18-2013 at 03:40 AM.. Reason: Code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

SFTP problem in HP UX

Dear All, Previously we push file using ftp in outside node. Now we try sftp, but connection is not established. I am provide you the debug log. Any idea to solve the issue? tabs@tabsdb02:/ccbs/users/tabs$ sftp -vvv e132079@205.140.6.188 OpenSSH_5.8p1+sftpfilecontrol-v1.3-hpn13v7,... (0 Replies)
Discussion started by: makauser
0 Replies

2. UNIX for Dummies Questions & Answers

Verbose command cp

Hi, I have sometimes a problem when i want to copy files from a nas, it's the nas which have a problem when it is very requested by a lot of users, the command cp turn and don't stop (the file size does not increase) and it's lock. Is it possible to verbose this command ? I try with the flag... (1 Reply)
Discussion started by: protocomm
1 Replies

3. UNIX for Dummies Questions & Answers

Unix (compressed archieve, non-verbose)

I'm confusing with this question. :wall: Can any one tell me how to do and use which command? :confused: create a compressed archive of the "Test" directory and it's contents, called Test.tar.gz, and place it in the current directory. Use a non-verbose tar command with a single string, including... (5 Replies)
Discussion started by: wk9031
5 Replies

4. UNIX for Dummies Questions & Answers

Routing a verbose information to a log file

Hi All, In the script mentioned below uses a sftp command to login to the remote host and pull the files from the remote server. we want to log this inf to a log file . But it is not happening, the verbose information is just displayed on the screen but not to the log file when I run this... (1 Reply)
Discussion started by: raghuveer2008
1 Replies

5. Shell Programming and Scripting

Problem with SFTP...

Hi, Here is my problem::confused: Daily my ETL process will create 4 (Four) Flatfiles in unix box. Upon creation of the flatfiles, I need to do "SFTP" the files to a "Remote Server". Sometimes While doing SFTP, the files get trucated due to it's size. Now I would like to design a Korn... (3 Replies)
Discussion started by: npk2210
3 Replies

6. Shell Programming and Scripting

Getting cURL to output verbose to a file

This is about to drive me crazy. What I want to do is simple: output ALL the verbose information from curl to a file I have read the manual, tried several options and searched this forum but no salvation... I'm using curl -k -Q "command" --user user:passwd --ftp-pasv --ftp-ssl -v... (1 Reply)
Discussion started by: caramandi
1 Replies

7. UNIX for Advanced & Expert Users

Problem using sftp

Hi my sftp batch run connect to the server and transfer the txt file to target server. but when I run again same batch with same file it give error. Any idea about this error..... regards Jamil edit by bakunin: please do not "hijack" threads. That is: if you have a genuine... (1 Reply)
Discussion started by: Jamil Qadir
1 Replies

8. Shell Programming and Scripting

problem with SFTP

Hi, I am doing a FTP from a Unix host to a windows host. I have generated the key in my unix server and added them in the destination host. In the Destination they changed the ip address now i am not able to connect. I can see it is reaching till that server but i am not receiving that server... (2 Replies)
Discussion started by: Krrishv
2 Replies

9. Shell Programming and Scripting

sftp verbose output

We need to use sftp to replace the ftp on all our application scripts. The command itself works, however,the output from the verbose is not giving us a success response with a transfer count. Our processes require that we interrogate the response to ensure the data transfer was successful. ... (2 Replies)
Discussion started by: MizzGail
2 Replies

10. Shell Programming and Scripting

python vs bash - verbose mode

hey all! i'm looking how to render verbose python scripts. what i'm looking for would be an equivalent to a "bash -xf" in bash script headers.. Any help? (2 Replies)
Discussion started by: penguin-friend
2 Replies
Login or Register to Ask a Question