I need to create a bash script that will connect to an FTP server, upload a file and close the connection. Usually this will be an easy task but I have to specify some specific proxy settings which are making it difficult.
I can connect to FTP settings using a GUI client i.e. Filezilla:
Proxy settings ------------ - FTP Proxy: USER @ HOST Proxy Host: Proxy.domain.com Proxy User: Blank proxy pass: empty
FTP settings ---- ---- Host: 200.200.200.200 Port: 21 users: foo pass: Bar
I can not seem to do a text-based ftp client to repeat these settings within ie ftp, lftp etc. Anyone can help to install this script << P>
, lftp should support the ftp_proxy environment variable, such as ftp_proxy = Ftp: //proxy.dom Ain.com lftp -c "cd / upload file;" ftp://200.200.200.200 If that works, you
export ftp_proxy = ftp: //proxy.domain.com. Set or
in your shell configuration files: ftp: proxy = ftp: //proxy.domain.com your ~ / .lftprc.
Alternatively, try running the command that your GUI FTP client is running, e.g.
upload.lftp USER ... @ ... pass ... PUT ... and run it using -s : lftp -s upload.lftp 200.200.200.200 Or try curl-t () ncftpput (). Something like this:
FTP_PROXY = ftp: //proxy.domain.com curl -t upload file -U fu: bar FTP: //200.200.200.200 / MyFile < / Code> can work.
Comments
Post a Comment