![lftp: 로그인하고, 원격 디렉터리에 파일을 넣은 다음 단일 명령으로 종료합니다. 도움말을 올바르게 인용합니다.](https://linux55.com/image/50831/lftp%3A%20%EB%A1%9C%EA%B7%B8%EC%9D%B8%ED%95%98%EA%B3%A0%2C%20%EC%9B%90%EA%B2%A9%20%EB%94%94%EB%A0%89%ED%84%B0%EB%A6%AC%EC%97%90%20%ED%8C%8C%EC%9D%BC%EC%9D%84%20%EB%84%A3%EC%9D%80%20%EB%8B%A4%EC%9D%8C%20%EB%8B%A8%EC%9D%BC%20%EB%AA%85%EB%A0%B9%EC%9C%BC%EB%A1%9C%20%EC%A2%85%EB%A3%8C%ED%95%A9%EB%8B%88%EB%8B%A4.%20%EB%8F%84%EC%9B%80%EB%A7%90%EC%9D%84%20%EC%98%AC%EB%B0%94%EB%A5%B4%EA%B2%8C%20%EC%9D%B8%EC%9A%A9%ED%95%A9%EB%8B%88%EB%8B%A4..png)
나는 한 번에 전체 세션을 수행하고 싶었고 lftp -c
(나중에 스크립트를 통해 시작할 것이기 때문에) 성공했지만 -e
종종 원하지 않는 대화형 세션이 남았습니다.
수동 상태
-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"
그냥 나에게 소리치거나 실제로 내가 시도한 인용문의 조합( ||
또는 &&
무엇이든)
답변1
$ 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
답변2
lftp -e "put -O remote/dir/ /local/file.txt; bye" -u user,pass ftpsite.com
답변3
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에 비밀번호를 입력하는 것은 절대 금물입니다.