[root@mondeo home]# cd /root/.ssh/ [root@mondeo .ssh]# ssh-keygen -d Generating public/private dsa key pair. Enter file in which to save the key (/root/.ssh/id_dsa): Enter passphrase (empty for no passphrase): <-- 此處不打passphrase..下次才不會詢問password Enter same passphrase again: Your identification has been saved in /root/.ssh/id_dsa. Your public key has been saved in /root/.ssh/id_dsa.pub. The key fingerprint is: 11:22:33:44:55:66:77:88:99:00:11:22:33:44:55:66 root@mondeo.adj.idv.tw [root@mondeo .ssh]# |
[root@mondeo .ssh]# scp id_dsa.pub 192.168.0.1:/root/.ssh/authorized_keys2 root@192.168.0.1's password: id_dsa.pub 100% |***************************************************************************| 612 00:00 [root@mondeo .ssh]# |
[root@linux /]#chkconfig --list rsync rsync off [root@linux /]#chkconfig rsync on |
[root@mondeo /]# mkdir backup [root@mondeo backup]#vi sync rsync -avlR --delete -e ssh 192.168.0.1:/var/lib/mysql /backup/ rsync -avlR --delete -e ssh 192.168.0.1:/var/www/html /backup/ [root@mondeo backup]#chmod 700 sync |
[root@mondeo backup]# ./sync receiving file list ... done . . . done wrote 16 bytes read 107 bytes 82.00 bytes/sec total size is 0 speedup is 0.00 receiving file list ... done . . . done wrote 16 bytes read 921 bytes 624.67 bytes/sec total size is 308331 speedup is 329.06 [root@mondeo backup]# |
[root@mondeo backup]# crontab -e0 0 * * * /backup/sync |
原帖由 adj 於 2007-11-14 22:07 發表
一.前言自從911事件之後...異地備援這個名稱就常聽人提起...不過就是滿少看到大家在冷氣維修推薦討論...剛好這次因為有需要...不得不研究這個東西...順便看看大家都是怎樣實作異地備援的...底下是個人的一點點心得...這次主要分 ...
歡迎光臨 ADJ網路實驗室 (http://dz.adj.idv.tw/) | Powered by Discuz! 6.0.0 |