• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to redirect ftp output to a file from shell script?

 
manoj r patil
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one cronjob bash script which is performing different ftp tasks. I want to ouput of the ftp commands to some file for some intermidiate processing. How can I do that from within the script?

Below is the sample extract of ftp I am using -

ftp 10.x.x.45 << INPUT_END

# different ftp commands...

INPUT_END
 
Rahul Chaudhari
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use fillowing line in your script. It writes the output of FTP in Specified file.

ftp 10.x.x.45 > FILENAME << INPUT_END

# different ftp commands...

INPUT_END
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic