Operating System - HP-UX
1752577 Members
4622 Online
108788 Solutions
New Discussion юеВ

Re: How can I output the ftp result to a text file

 
SOLVED
Go to solution
SSKong_1
Occasional Contributor

How can I output the ftp result to a text file

Hello,

I would like to know how can I output the ftp result to a text file ?

Thanks,
Kong
5 REPLIES 5
Rajeev  Shukla
Honored Contributor

Re: How can I output the ftp result to a text file

Do you mean to get the result from a manually triggered ftp, its thats the case then run scripts filename
this will record everything in the shell until you type exit
And if you want from your automated script then run the script with
> /tmp/ftp.log 2>&1 option
SSKong_1
Occasional Contributor

Re: How can I output the ftp result to a text file

Hi Rajeev,

Thanks for your reply.

Yes, I wanted to capture the manual triger ftp result to a text file. Can you please provide more details. I'm not clear with your explaination.

Thanks.
Rajeev  Shukla
Honored Contributor
Solution

Re: How can I output the ftp result to a text file

type the command
$script /tmp/ftp.log
$ftp ...... carry on with your ftp commands
once finished type
$exit
you'll have a file /tmp/ftp.log created with all your outputs and inputs in there.

Indira Aramandla
Honored Contributor

Re: How can I output the ftp result to a text file

Hi Kong,

If you are having the ftp statements in a scripts then do this

ftp -i -n -v sever_name or IP address << ENDFTP > /path/ftp_output.log
user username password
change the directory for the file on target server
lcd /path/source directory
mput filename
bye
ENDFTP

The file ftp_output.log will have all the ftp commnads and output statements.


IA
Never give up, Keep Trying
Peter Nikitka
Honored Contributor

Re: How can I output the ftp result to a text file

Hi,

you can try

ftp hostname | tee /tmp/ftp.log

The 'tee' command will send all output to stdout and the file argument.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"