Необходимо из скрипта закидывать файл по ftp на удаленный сервер.Делаю так
# lftp -e "put file.txt" -u user,password xxx.xxx.xxx.xxx
51050 bytes transferred
lftp user@xxx.xxx.xxx.xxx:/>все отлично, за исключением того, что он не выходит из сессии. После прочтения мана нашел, что надо использовать ключ -с
-c commands
Execute the given commands and exitпробую
# lftp -c "put file.txt" -u user,password xxx.xxx.xxx.xxx
Unknown command `put file.txt'.Я что то не так делаю?
# lftp -v
LFTP | Version 3.7.14 | Copyright (c) 1996-2009 Alexander V. Lukyanov
А глянуть в tutorial не судьба. Я вот lftp не использую, но мне хватило одной минуты чтобы найти следующее:To end this section on basic usage we might as well download something. In order to do this we can connect and then use the get or mget command but let us issue one command instead. We do so using this form:
$ lftp -c 'open -e "<cmd> <item>" <URL>'There is a nested command there. Very nice.
Below we download the magnificient lsof program that lies in waiting as a package on an OpenBSD server:
$ lftp -c 'open -e "mget lsof*" ftp.openbsd.org/pub/OpenBSD/3.7/packages/i386'
>[оверквотинг удален]
>something. In order to do this we can connect and then
>use the get or mget command but let us issue one
>command instead. We do so using this form:
>$ lftp -c 'open -e "<cmd> <item>" <URL>'
>
>There is a nested command there. Very nice.
>
>Below we download the magnificient lsof program that lies in waiting as
>a package on an OpenBSD server:
>$ lftp -c 'open -e "mget lsof*" ftp.openbsd.org/pub/OpenBSD/3.7/packages/i386'Мне нужно залить файл, а не скачать, вот именно put и не работает.
Что в моем примере я не правильно указал?
>Мне нужно залить файл, а не скачать, вот именно put и не
>работает.Ну извини, я думал, что замена mget на put слишком очевидна, чтобы о ней упоминать.
>Что в моем примере я не правильно указал?
не было open.
>>Мне нужно залить файл, а не скачать, вот именно put и не
>>работает.
>
>Ну извини, я думал, что замена mget на put слишком очевидна, чтобы
>о ней упоминать.
>
>>Что в моем примере я не правильно указал?
>
>не было open.Странно, что при использовании -e open не нужен, это меня и смутило
>[оверквотинг удален]
>
>пробую
>
># lftp -c "put file.txt" -u user,password xxx.xxx.xxx.xxx
>Unknown command `put file.txt'.
>
>Я что то не так делаю?
>
># lftp -v
>LFTP | Version 3.7.14 | Copyright (c) 1996-2009 Alexander V. LukyanovУже нашел решение
# lftp -c 'open xxx.xxx.xxx.xxx -u user,password; put file.txt'