當前位置:首頁 » 文件管理 » lftp上傳文件

lftp上傳文件

發布時間: 2022-10-02 15:55:08

『壹』 linux中的lftp上傳文件出現Access failed: 553怎麼弄我配置過vsftpd.conf文件了

553的錯誤意思是:請求操作未被執行, 文件名不允許

『貳』 linux下怎麼用命令上傳本地文件到遠程伺服器

遠程linux伺服器開啟ftp服務。並為ftp分配好賬號密碼就可以通過ftp上傳文件了

『叄』 想將ubuntu下某個文件夾下的文件定時上傳至FTP或者共享文件夾,也可以直接傳至另一台LINUX上使用。

寫的一個簡單腳本.
linux1 = A (不定時生成文件)
linux2 = B (需隔一天後使用文件)
B 主機必須提供FTP服務,建立相應的FTP用戶,具備相應的上傳許可權和容量等.
/home/backup :文件備份臨時目錄
/home/bak :本地文件備份目錄
注意:如果伺服器語言為英文,請將腳本內中文注釋改為英文或刪除.

A 主機
-----------------------------------------------------------------------
mkdir /home/backup
mkdir /home/bak
vi /home/backup.sh
vi /etc/crontab
30 2 * * * root /home/backup.sh
#建立目錄,設置每天2:30定時執行備份腳本

backup.sh內容

#!/bin/bash
#
# 說明:
# 自動備份本機文件到遠程FTP
#
PATH=/bin:/usr/bin:/sbin:/usr/sbin
LANG=C
LC_ALL=C
# 設置A路徑
date='date +%Y-%m-%d'
bakdir=/home/backup
home=/home
# A主機 "/etc/目錄下的文件"
cp -a /etc/* $bakdir
# 延遲20S,等文件拷貝結束
sleep 20s
sync;sync
# 在本機壓縮與打包
cd $bakdir
tar -zcf "$date".tar.gz *
sleep 20s
sync;sync
# 備份到B主機
id="username"
pw="yourpassword"
cd= $bakdir
# 利用FTP備份到192.168.1.200
ftp -n 192.168.1.200 > $home/ftp.log 2>&1 <<EOC
user $id $pw
binary
cd $bakdir
put "$date".tar.gz
bye EOC
sync;sync
# 移動到本機備份
mv $bakdir/"$date".tar.gz $bakdir/bak
sleep 20s
sync;sync

『肆』 Linux中lftp命令

ncftp 工具的使用
ftp 全名為 File Transfer Protocol(檔案傳輸協定),File Transfer Protocol 主要的功用是在 TCP/IP 網路上傳送檔案,常見的 ftp 工具有 ,ftp gftp lftp ncftp mc proz wget 等。檔案傳輸在系統管理及運用上十分常見,請務必學會其中一種,以下以 ncftp 示範。

##########################################################################
行前教育
ncftp 的使用方法與 command line 下的 Bash 用法相近,以下是常用指令:
cd 切換目錄
mkdir 建立目錄
rmdir 砍掉空目錄
del 砍掉檔案
get 取回檔案
put 將檔案放上去
##########################################################################
使用 ncftp 登入需帳號密碼的 ftp server
語法為 ncftp -u USERNAME IP-address
or
語法為 ncftp -u USERNAME Hostname
##########################################################################
lloyd@alver:~$ ncftp -u lloyd 127.0.0.1
NcFTP 3.1.3 (Mar 27, 2002) by Mike Gleason ([email protected]).
Connecting to 127.0.0.1...
alver.coventive.com FTP server (Version 6.4/OpenBSD/Linux-ftpd-0.17) ready.
Logging in...
Password requested by 127.0.0.1 for user "lloyd".

Password required for lloyd.

Password: ## 輸入密碼 ##
Linux alver 2.4.18 #22 周六 8月 3 10:58:28 CST 2002 i686 unknown

Most of the programs included with the Debian GNU/Linux system are
freely redistributable; the exact distribution terms for each program
are described in the indivial files in /usr/share/doc/*/right

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
User lloyd logged in.
Logged in to 127.0.0.1.
ncftp /home/lloyd > cd DOC/ # 切換目錄到 DOC
ncftp /home/lloyd/DOC > ls # 列出該目錄下的檔案與目錄
123/ LLOYD/ tech-report.ps VCD
5_SGML/ minigateway/ user_manual.pdf XRoadTerm/
i18n/ radius/ user_manual.ps XRoadTerm.tar.gz
ncftp /home/lloyd/DOC > help # 線上求助
Commands may be abbreviated. 'help showall' shows hidden and unsupported
commands. 'help <command>' gives a brief description of <command>.

ascii cat help lpage open quote site
bgget cd jobs lpwd page rename type
bgput chmod lcd lrename pdir rhelp umask
bgstart close lchmod lrm pls rm version
binary debug lls lrmdir put rmdir
bookmark dir lmkdir ls pwd set
bookmarks get lookup mkdir quit show
ncftp /home/lloyd/DOC > get XRoadTerm.tar.gz # 以 get 取回 XRoadTerm.tar.gz 檔案
XRoadTerm.tar.gz: 20.50 kB 563.41 kB/s
ncftp /home/lloyd/DOC > quit # 離開
You have not saved a bookmark for this site.

Would you like to save a bookmark to:
ftp://lloyd:[email protected]/DOC/

Save? (yes/no) no # 要儲存帳號密碼當成 bookmark 使用嗎?
# 建議回答 no
Not saved. (If you don't want to be asked this, "set confirm-close no")

lloyd@alver:~$ ls -l XRoadTerm.tar.gz # 回到 shell 下,查看檔案是否抓回來了
-rw-r--r-- 1 lloyd lloyd 20993 6月 24 14:19 XRoadTerm.tar.gz
lloyd@alver:~$

##########################################################################
使用 ncftp 登入提供 anonymous 的 ftp server (公眾使用無須帳號密碼的 ftp
server )
語法為 ncftp P-address
or
語法為 ncftp Hostname
以下以中山 ftp server 為例:
##########################################################################
lloyd@alver:~$ ncftp ftp.nsysu.e.tw # 除了這里不同外其餘用法相同
NcFTP 3.1.3 (Mar 27, 2002) by Mike Gleason ([email protected]).
Connecting to 140.117.11.7...
====================================================================
歡迎光臨檔案伺服器.
Welcome to National Sun Yat-Sen University FTP Server (ftp.nsysu.e.tw).
右列網址提供本站檔案搜尋引擎
File Search Engine on the URL
目前 FTP 部份有 289 人正在線上,最高限制 5000 人.
There are currently 289 users out of 5000 possible.
====================================================================
Only anonymous FTP is allowed here. Please login as 'ftp'.
Logging in...
========================================================================
!!!! Important Function !!!! (重要功能介紹)
o 'cd key*word' or 'cd prefix*' or 'cd *suffix' provided (case-insentive).
(例:cd freebsd 可以打成 cd fr 或 cd *sd 或 cd f*e*d 都通用,大小寫都行)
========================================================================
請多多利用 <A HREF=""></A>
可以使用方便的檔案搜尋引擎喔!!!!!!!!!!!!!!!!!
========================================================================
ADM.Email: [email protected]

Anonymous user (202.145.53.89) logged in
Unknown command
Logged in to ftp.nsysu.e.tw.
ncftp /pub > cd Windows
ncftp /pub/Windows > ls
Collection/ Mobile@ SAC@ WindowsNT/
Demo/ MsDownload/ Simtelnet/ Winsock-l/
ncftp /pub/Windows > cd Collection/
ncftp /pub/Windows/Collection > ls
CDR-Soft/ Image/ MultiMedia/ Sound/
Driver/ LIB/ Network/ WWW/
ncftp /pub/Windows/Collection > quit

You have not saved a bookmark for this site.

Would you like to save a bookmark to:
ftp://ftp.nsysu.e.tw/Windows/Collection/

Save? (yes/no) no
Not saved. (If you don't want to be asked this, "set confirm-close no")

lloyd@alver:~$

請參考,希望能幫到你。

『伍』 LFTP是什麼意思

ncftp 工具的使用
ftp 全名為 File Transfer Protocol(檔案傳輸協定),File Transfer Protocol 主要的功用是在 TCP/IP 網路上傳送檔案,常見的 ftp 工具有 ,ftp gftp lftp ncftp mc proz wget 等。檔案傳輸在系統管理及運用上十分常見,請務必學會其中一種,以下以 ncftp 示範。

##########################################################################
行前教育
ncftp 的使用方法與 command line 下的 Bash 用法相近,以下是常用指令:
cd 切換目錄
mkdir 建立目錄
rmdir 砍掉空目錄
del 砍掉檔案
get 取回檔案
put 將檔案放上去
##########################################################################
使用 ncftp 登入需帳號密碼的 ftp server
語法為 ncftp -u USERNAME IP-address
or
語法為 ncftp -u USERNAME Hostname
##########################################################################
lloyd@alver:~$ ncftp -u lloyd 127.0.0.1
NcFTP 3.1.3 (Mar 27, 2002) by Mike Gleason ([email protected]).
Connecting to 127.0.0.1...
alver.coventive.com FTP server (Version 6.4/OpenBSD/Linux-ftpd-0.17) ready.
Logging in...
Password requested by 127.0.0.1 for user "lloyd".

Password required for lloyd.

Password: ## 輸入密碼 ##
Linux alver 2.4.18 #22 周六 8月 3 10:58:28 CST 2002 i686 unknown

Most of the programs included with the Debian GNU/Linux system are
freely redistributable; the exact distribution terms for each program
are described in the indivial files in /usr/share/doc/*/right

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
User lloyd logged in.
Logged in to 127.0.0.1.
ncftp /home/lloyd > cd DOC/ # 切換目錄到 DOC
ncftp /home/lloyd/DOC > ls # 列出該目錄下的檔案與目錄
123/ LLOYD/ tech-report.ps VCD
5_SGML/ minigateway/ user_manual.pdf XRoadTerm/
i18n/ radius/ user_manual.ps XRoadTerm.tar.gz
ncftp /home/lloyd/DOC > help # 線上求助
Commands may be abbreviated. 'help showall' shows hidden and unsupported
commands. 'help <command>' gives a brief description of <command>.

ascii cat help lpage open quote site
bgget cd jobs lpwd page rename type
bgput chmod lcd lrename pdir rhelp umask
bgstart close lchmod lrm pls rm version
binary debug lls lrmdir put rmdir
bookmark dir lmkdir ls pwd set
bookmarks get lookup mkdir quit show
ncftp /home/lloyd/DOC > get XRoadTerm.tar.gz # 以 get 取回 XRoadTerm.tar.gz 檔案
XRoadTerm.tar.gz: 20.50 kB 563.41 kB/s
ncftp /home/lloyd/DOC > quit # 離開
You have not saved a bookmark for this site.

Would you like to save a bookmark to:
ftp://lloyd:[email protected]/DOC/

Save? (yes/no) no # 要儲存帳號密碼當成 bookmark 使用嗎?
# 建議回答 no
Not saved. (If you don't want to be asked this, "set confirm-close no")

lloyd@alver:~$ ls -l XRoadTerm.tar.gz # 回到 shell 下,查看檔案是否抓回來了
-rw-r--r-- 1 lloyd lloyd 20993 6月 24 14:19 XRoadTerm.tar.gz
lloyd@alver:~$

##########################################################################
使用 ncftp 登入提供 anonymous 的 ftp server (公眾使用無須帳號密碼的 ftp
server )
語法為 ncftp P-address
or
語法為 ncftp Hostname
以下以中山 ftp server 為例:
##########################################################################
lloyd@alver:~$ ncftp ftp.nsysu.e.tw # 除了這里不同外其餘用法相同
NcFTP 3.1.3 (Mar 27, 2002) by Mike Gleason ([email protected]).
Connecting to 140.117.11.7...
====================================================================
歡迎光臨檔案伺服器.
Welcome to National Sun Yat-Sen University FTP Server (ftp.nsysu.e.tw).
右列網址提供本站檔案搜尋引擎
File Search Engine on the URL
目前 FTP 部份有 289 人正在線上,最高限制 5000 人.
There are currently 289 users out of 5000 possible.
====================================================================
Only anonymous FTP is allowed here. Please login as 'ftp'.
Logging in...
========================================================================
!!!! Important Function !!!! (重要功能介紹)
o 'cd key*word' or 'cd prefix*' or 'cd *suffix' provided (case-insentive).
(例:cd freebsd 可以打成 cd fr 或 cd *sd 或 cd f*e*d 都通用,大小寫都行)
========================================================================
請多多利用 <A HREF=""></A>
可以使用方便的檔案搜尋引擎喔!!!!!!!!!!!!!!!!!
========================================================================
ADM.Email: [email protected]

Anonymous user (202.145.53.89) logged in
Unknown command
Logged in to ftp.nsysu.e.tw.
ncftp /pub > cd Windows
ncftp /pub/Windows > ls
Collection/ Mobile@ SAC@ WindowsNT/
Demo/ MsDownload/ Simtelnet/ Winsock-l/
ncftp /pub/Windows > cd Collection/
ncftp /pub/Windows/Collection > ls
CDR-Soft/ Image/ MultiMedia/ Sound/
Driver/ LIB/ Network/ WWW/
ncftp /pub/Windows/Collection > quit

You have not saved a bookmark for this site.

Would you like to save a bookmark to:
ftp://ftp.nsysu.e.tw/Windows/Collection/

Save? (yes/no) no
Not saved. (If you don't want to be asked this, "set confirm-close no")

lloyd@alver:~$

『陸』 linux系統給ftp伺服器上傳文件,ftp,lftp,mput哪個好謝謝

首先,不建議你上傳整個目錄,首先是上傳速度會慢,如果文件數量過多,還有可能造成文件損壞。建議是先tar打包後直接上傳這個文件,然後再解壓
如果你非要上傳文件夾,命令如下(前提是已經連接sftp)
put -r dir/.
在一個已連接的sftp中執行這個命令,dir/後面必須有.否則會報錯
注意:這個命令是上傳 dir 目錄中的文件和子目錄,並不上傳 dir 目錄本身

『柒』 如何用命令行上傳/下載整個文件夾到ftp伺服器 lftp

首先,ftp命令是肯定不行的,必須用lftp。
上傳整個文件夾:mirror
-R
本地文件夾
下載整個文件夾:mirror
遠端文件夾
本地文件夾

『捌』 增量備份 如何使用lftp進行增量網站備份 lftp命令實例介紹

LFTP簡單命令 lftp ftpsite 如果是需要密碼的話,可以使用以下命令連接。 lftp -u username,password ftpsitemirror命令為了同步本地的一個文件夾到遠程文件夾,lftp增加了mirror命令。不用設置其它的選項,你只需要指定本地目錄和遠程目錄即可。用法: mirror -R 本地目錄 遠程目錄 mirror命令提供了幾個實用的選項來控制同步進程。例如使用–delete選項,mirror命令會刪除遠程備份伺服器中存在的文件而本地伺服器不存在的文件,當使用–only-newer選項時lftp只上傳新的文件。另一個選項是–exclude,它允許你指定不需要同步的文件夾。如果你想監視同步的進程,可以使用–verbose選項。 增量備份同步命令 每次同步時都要先執行lftp,再執行mirror命令是一件很煩人的事,幸運的事,lftp軟體支持把兩條命令合成一條,你只需要添加-e選項就可以告訴lftp執行連接伺服器後接著運行指定命令。如下: lftp -u username,password -e "mirror -R --delete --only-newer --verbose 本地目錄 遠程目錄" ftpsite 你也可以把命令存在一個文件裡面,只需要添加-f選項。 lftp -f /home/user/ftpscript.txt LFTP定時運行 lftp at 00:00 -u username,password -e "mirror -R --delete --only-newer --verbose 本地目錄 遠程目錄" ftpsite & 注意&符號,它表示讓命令在後台運行而不需要一直開著終端。

『玖』 linux ftp伺服器不允許上傳

許可權問題吧,應該把ftp共享出來的目錄加上寫的許可權,一般是/var/ftp/pub
chmod
777
/var/ftp/pub
這樣應該就可以了

『拾』 求一個可以上傳文件夾到FTP指定目錄的批處理命令

先生成一個配置文件d:\ FTPCommand.txt,內容如下:
open 主機IP 例:10.1.2.3
username 例:root
password 例: root
prompt off
mput filename #可使用通配符或多個文件名
如果需要的話可能還要更改當前路徑

然後在命令行運行:ftp -s:"d:\ FTPCommand.txt"

熱點內容
配置不高pr哪個版本最好用 發布:2024-10-09 01:57:15 瀏覽:787
編譯OpenWrtipv6 發布:2024-10-09 01:51:40 瀏覽:122
python寫入位元組 發布:2024-10-09 01:24:22 瀏覽:647
如何設置超高難度密碼 發布:2024-10-09 01:19:05 瀏覽:177
linux只讀文件修改 發布:2024-10-09 01:13:08 瀏覽:84
安卓機電腦用什麼檢測 發布:2024-10-09 01:10:20 瀏覽:671
有關資料庫的工作 發布:2024-10-09 00:52:12 瀏覽:734
代碼分析演算法 發布:2024-10-09 00:47:11 瀏覽:163
晶元寫程序需要配置哪些文件 發布:2024-10-09 00:38:39 瀏覽:936
存儲儲存搬運 發布:2024-10-09 00:28:42 瀏覽:718