Operating System - HP-UX
1834142 Members
2365 Online
110064 Solutions
New Discussion

ftp sessions error/success messages sent to a log file

 
SOLVED
Go to solution
Shahryar Solaimani
New Member

ftp sessions error/success messages sent to a log file

How can I redirect the stderr and stdout from a ftp session to a log file when I sun ftp command in a shell script? Thanks
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor
Solution

Re: ftp sessions error/success messages sent to a log file

Hi:

You can do something like this:

{
echo "open thehost
user uuu ppp
hash
put myfile
close"
} | ftp -i -n -v > /tmp/ftplog.$$ 2>&1

...JRF...
Fred Martin_1
Valued Contributor

Re: ftp sessions error/success messages sent to a log file

Would regular syslog entries do? In the file /etc/inetd.conf, if you put the -l and -v switch on ftpd, all activity is logged to the syslog. This includes logins, files transferred, all commands exectuted.
fmartin@applicatorssales.com