Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture standard error messages in log

Status
Not open for further replies.

bharix

Programmer
Aug 6, 2002
23
DE
Guys,
I am writing a ftp script. Sometimes it happens that my ftp
session times out showing error on the terminal.
"Connection timed out".

My problem is that I am not able to capture this error message in the log file.

Even though I use following construct, the (error) message
is not getting captured in log.

Could you please let me know how to capture this message
in log so that I can grep it and report error though my script?

ftp -ivn xxx.xxx.xxx.xx <! >> $LOG
user xyz xyzpass
cd DIR
mget *.txt
bye
!

TIA,
bharix.
 
This will redirect the erroroutput to the same logfile.

ftp -ivn xxx.xxx.xxx.xx <! >> $LOG 2>&1
user xyz xyzpass
cd DIR
mget *.txt
bye
!

Regards,
RN
 
Worked!
Thanks for the reply. Appreciate it.

Bharix.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top