나는 lftp -c
한 번에 전체 세션을 수행 하고 싶고 (나중에 스크립트에서 이것을 시작할 것이므로) 관리 -e
했지만 그 ofc는 내가 원하지 않는 대화 형 세션을 남겨 둡니다.
수동 상태
-c commands
Execute the given commands and exit. Commands can be separated with a semicolon, `&&'
or `||'. Remember to quote the commands argument properly in the shell. This option
must be used alone without other arguments.
그러나 명령 / 상호 작용을 올바르게 인용하고 묶는 방법을 이해하지 못합니다.
lftp -e "put -O remote/dir/ /local/file.txt" -u user,pass ftpsite.com
훌륭하게 작동합니다. 그러나 명령을 실행 한 후 종료하고 싶습니다.
lftp -c "open -u user,pass ftpsite.com" || put -O "remote/dir/ /local/file.txt"
나에게 소리 지르거나 실제로 시도한 따옴표 조합 ( ||
또는 &&
상관없이)
답변
$ lftp -c "open -u user,pass ftpsite.com; put -O remote/dir/ /local/file.txt"
해야합니다.
그래도 문제가 해결되지 않으면 /etc/lftp.conf
다음 줄을 추가하십시오 .
set ftp:ssl-protect-data true
set ftp:ssl-force true
set ftp:ssl-auth TLS
set ssl:verify-certificate no
답변
lftp -e "put -O remote/dir/ /local/file.txt; bye" -u user,pass ftpsite.com
답변
lftp -e "put -O remote/dir/ /local/file.txt; bye" ftp.yourhost.com
~ / .netrc 아래에 자격 증명을 넣습니다.
machine ftp.yourhost.com login your_username password your_password
bash 기록 옆에 업로드하는 동안 ps -aux를 사용할 때 암호를 읽을 수 있기 때문에 cli에 암호를 넣는 것은 절대로 할 일이 없습니다.