Linux 簡單檔案複製

來源:互聯網
上載者:User
檔案複製系統既可以使用一種“推(push)”模型,也可使用一種“拉(pull)”模型。以下是常見的幾個複製檔案的命令:

推檔案:

rdist:
rdist -P /usr/bin/ssh -f distfile 

控制檔案 distfile 的內容如下:
la: /home/xueying/tt1 -> 10.1.8.177 install /home/xueying/tt1;

(注意:rdist 的預設行為會刪除目的主機上已有,而在源主機上又沒有對應檔案的檔案!)
要讓 rdist 在多台機器間工作,必須讓接收方主機上的 sshd 信任你正在上面分發檔案的主機。要做到這一點,可以為主控機產生一個純文字的密鑰,並儲存每台接收方主機上 ~root/.ssh/authorized_keys 檔案中的公用部分的副本。參考:這裡。

rsync:
rsync -gopt -e ssh /home/xueying/tt1 10.1.8.177:/home/xueying/tt2

拉檔案:

wget:
wget http://fanqiang.chinaunix.net/app/rsync/2001-09-08/2729.shtml -P /home/xueying
(URL 可以是 FTP 或者 HTTP)

ncftp:
ncftpget ftp://ftp.rpmfind.net/linux/conectiva/samba/6.0/samba-clients-2.2.0-2cl.i386.rpm
ncftpput ftp.rpmfind.net /linuxboy/debiandocs debiantouch

Linux 共用系統檔案還可以使用 NIS、LDAP 等。有機會再專門研究一下。 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.