On twitter

RT @beichen: 温家宝回应“谷歌”事件说,让外企享受到公民待遇。看来谷歌是铁定是要滚蛋了。

follow me on twitter

使用 rsync 來進行備份 2

自己弄主機寫程式真的可以學到很多東西阿 (茶) 但是一定還會忘記的, 所以要記錄一下 XD 不過有設定過, 讓東西可以跑的起來, 就多少可以了解東西是怎麼跑的, 然後… 等有時間再來深入研究, 這就是所謂的… “先講求不傷身, 在講求療效”阿! (茶) ….

記錄一下 rsync 的東西。 以下為主機 A (server) 備份到主機 B (client)

主機 A 的 rsync server 設定:
/etc/rsyncd.conf

pid file = /var/run/rsyncd.pid
use chroot = yes
read only = yes
uid = root
gid = root
list = yes
hosts allow = 196.168.1.1
hosts deny = *

[www]
comment = websites file
path = /var/www
auth users = username
secrets file = /etc/rsyncd.secrets

/etc/rsyncd.secrets

username:password

 

主機 B 進行備份的主機指令

# RSYNC_PASSWORD=password rsync -rlHpogDtS –delete username@tzangms.com::www /var/www_backup

September 29th, 2008 Linux Tags: ,

2 Responses to “使用 rsync 來進行備份”

  1. ijliao says:

    你如果不是要做 backup server 的話其實不用這麼厚工
    直接用 rsync over ssh 就搞定

    rsync -av –rsh=ssh localdir remotehost:remotedir

    如果不想打密碼的話, 就搭一下 pubkey auth (ssh) 吧

  2. tzangms says:

    @ijliao
    感謝廖大!!! 我來研究一下! (跪拜)

Leave a Reply

Partners of Oceanic / 人生海海

jiwo sca wellmeet