Need help with lftp to automate file transfers
Howdy Folks,
For the longest time I've been using a "here" statement with the old ftp program on SLES 8-11 to automate file transfers from my server to another location by calling a function similar to this in my bash scripts: function ftp_my_file { /usr/bin/ftp -A -n <<here open some.ip.address user my_username my_password epsv4 bin put $FILE_TO_FTP quit here } This function has worked fine up until we upgraded to SLES 12 and the old FTP program was replaced with Lftp which doesn't use the same syntax. Does someone have a method in a script using lftp that does the same thing? Thanks. |
Quote:
I also note that binary is the default transfer mode, but the syntax to specify that is also different in lftp. The HERE document should continue to work once you modify the commands accordingly. Suggest you review man lftp. It should be easy enough to convert your script. |
I got it to work in my bash script --
lftp -e "set ftp:ssl-allow off; put $FILE_TO_FTP -o /fully/qualified/path/to/network/drive/$FILE_TO_FTP; bye" -u my_username,my_password some.ftpserver.local Note 1: if I pass along the password like this and the password contains special characters then escape them. Note 2: it's probably better to use ~/.netrc to store credentials. Will explore this. Note 3: initially I kept getting stuck on "making data connection". The "set ftp:ssl-allow off;" part prevents it from trying to use SSL. |
Quote:
|
All times are GMT -5. The time now is 01:00 AM. |