FTP error log


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers FTP error log
# 1  
Old 09-18-2012
FTP error log

Hi I'm here again.

This time I have a question that is not a really issue because I 've already found a workaround but I don't know if the behaviour is correct or not.

In my ksh shell I open a sftp connection to a remote machine.
this is the code:

Code:
sftp ${Csi_USER}@${Csi_HOST}<<EOF0 >> ${FTP_LOG_FILE} 2>> ${FTP_ERR_FILE}

where FTP_LOG_FILE and FTP_ERR_FILE are the files (with the path) for logging.
Meanwhile the FTP_LOG_FILE has always size > 0 I expect the opposite for FTP_ERR_FILE so only if there are errors the file should have size > 0.
Unfortunately this is not true because the FTP_ERR_FILE has always size > 0. It contains n lines one for an open connection like:
Connecting to 10.129.171.80...
Connecting to 10.129.171.80...
Connecting to 10.129.171.80...
Connecting to 10.129.171.80...
Is it possible to avoid this behaviour or it's the standard?
Thanks a lot.
# 2  
Old 09-18-2012
That may be because the sftp command is writing those lines to standard error (file descriptor 2) and not standard output (file descriptor 1). You don't see the difference (probably) while invoking sftp on the command line because for you, both standard error and standard output are the same, that is, the terminal.
Commands do this so that such messages aren't propagated to other commands in a pipeline.
 
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 FTP Script which is causing "syntax error: unexpected end of file" Error

Hi All, Please hav a look at the below peice of script and let me know if there are any syntax errors. i found that the below peice of Script is causing issue. when i use SFTP its working fine, but there is a demand to use FTP only. please find below code and explain if anything is wrong... (1 Reply)
Discussion started by: mahi_mayu069
1 Replies

2. Solaris

FTP log only shows FTP LOGIN FROM entry?

OS: Solaris 9 Configuration /etc/syslog.conf daemon.debug /etc/inetd.conf ftp stream tcp6 nowait root /usr/sbin/in.ftpd in.ftpd -A -l -d Found the ftp.log only generate those entries from other servers/hosts. Can we trace on all ftp entries either from/to the server? ... (6 Replies)
Discussion started by: KhawHL
6 Replies

3. Shell Programming and Scripting

FTP Log File

Hello, I need help to check content of ftp log files. I forgot to say that I am on Solaris 9. I am using KSH. I have 2 log files. Here is an example of content : LOG File from 21 October -rw-rw-r-- 1 cvbntr xarf 94974 Nov 1 2009 TAG__SC___2006175_0.TAB -rw-rw-r-- 1 cvbntr ... (3 Replies)
Discussion started by: Aswex
3 Replies

4. Shell Programming and Scripting

Anonymous ftp log?

Hello, I was wanting to know if there is any log/tracker for anonymous ftp activity for users that are logging in to our server. We migrated over to a new server and cleaning up some loose ends on the old server. We noticed that some files are being loaded on the old server via anonymous ftp.... (1 Reply)
Discussion started by: shorty
1 Replies

5. Shell Programming and Scripting

FTP Error 553 I/O error.

Hi All, I have a problem when uploading txt file from windows to Unix server. I got 533 I/O error. I am using .bat file and it works for other batches but with this particular batch it doesn't work. thanks guys for helping in advance. (2 Replies)
Discussion started by: sfaqih
2 Replies

6. UNIX for Dummies Questions & Answers

Question on FTP Error Log

Hello All, Below is the control card or the file which i am using in shell script to mget files from remote machine via FTP. bash-3.00$ cat ftp_ALD_DAC.log open 10.xx.yy.zzz user D00000187 nb8tr4xx2u ascii cd prod/out lcd /Internal_Impact_TT_Input mget ALD*.TXT bye Below is the... (0 Replies)
Discussion started by: Ariean
0 Replies

7. UNIX for Dummies Questions & Answers

Capturing FTP log

I am trying to do the FTP using .netrc.In my .netrc file in $HOME dir i am placing the machine ip,user name and pwd.Then i am creating dynamically a file which contains the ftp commands. My script is like below: __________________________________ export REMOTE_DIR= <some path> export... (4 Replies)
Discussion started by: dr46014
4 Replies

8. Shell Programming and Scripting

FTP and LOg file creation

Hello, I am new to unix , and I need to create a shell sciprt which helps me FTPing file from LAn to Unix box. These files r then processed using Perl script and put in a database. I also need to log the entire process of all the above methods in a log file in the same shell script. Like ,... (2 Replies)
Discussion started by: agarwalniru
2 Replies

9. UNIX for Dummies Questions & Answers

FTP server log

We would like to see : who is logging in to our box via ftp and what they did when logged in. THis would also be of value if the client ftp'ing in cannot get logged in and we'd like to look at it from our side (The ftp server side) So ..is there logging that can be turned on or available in... (2 Replies)
Discussion started by: ytakbob
2 Replies

10. UNIX for Dummies Questions & Answers

ftp log

Hi, I have been trying to write a script to maintain mu ftp log as to what time did the FTP start and till what time did it work I was unable to do it after several attempts, may be b'cos i'am new to Shell scripting. So can anyone provide me any solutions for this problem, as it would... (1 Reply)
Discussion started by: rajesh_vm
1 Replies
Login or Register to Ask a Question