本文共 5766 字,大约阅读时间需要 19 分钟。
[root@web ~]# ip a|grep eth0 2: eth0:mtu 1500 qdisc pfifo_fast qlen 1000 inet 192.168.1.106/24 brd 255.255.255.255 scope global eth0 [root@web~]#scp root@192.168.1.107:/root/.ssh/id_dsa.pub /root/.ssh/authorized_keys id_dsa.pub 100% 607 0.6KB/s 00:00 [root@web ~]# ls ~/.ssh/ authorized_keys id_rsa known_hosts
[root@jadeshow ~]# ssh 192.168.1.106 Last login: Sun Jun 20 22:30:54 2010 from jadeshow [root@jadeshow ~]# ssh 192.168.1.106 Last login: Sun Jun 20 22:31:29 2010 from jadeshow [root@web ~]# ifconfig eth0 Link encap:Ethernet HWaddr 00:0C:29:00:F0:ED inet addr:192.168.1.106 Bcast:255.255.255.255 Mask:255.255.255.0
[root@web ~]# ssh 192.168.1.107 root@192.168.1.107's password: 此处需要输入密码 Last login: Sun Jun 20 22:34:37 2010 from 192.168.1.106 [root@jadeshow ~]#
root@jadeshow .ssh]# rsync -av ~/ -e ssh 192.168.1.106:~/backup #-v 详细输出模式 -a, --archive 归档模式,表示以递归方式传输文件,并保持所有文件属性 -e 调用 ssh building file list ... done ./ .bash_history .bash_logout .bash_profile .bashrc .cshrc .tcshrc .viminfo anaconda-ks.cfg install.log install.log.syslog .gconf/ .gconf/apps/ .gconf/apps/%gconf.xml .gconf/apps/gnome-session/ .gconf/apps/gnome-session/%gconf.xml .gconf/apps/gnome-session/options/ .gconf/apps/gnome-session/options/%gconf.xml .gconfd/ .gconfd/saved_state .ssh/ .ssh/id_dsa .ssh/id_dsa.pub .ssh/id_rsa .ssh/known_hosts backup/ python/ python/fulijisuanqi.py python/python.py sent 35361 bytes received 514 bytes 23916.67 bytes/sec total size is 33739 speedup is 0.94
人工对比源和目标的文件数目 [root@jadeshow ~]# ls anaconda-ks.cfg backup install.log install.log.syslog python [root@web ~]# ls backup/ anaconda-ks.cfg backup install.log install.log.syslog python 总结 本次的的文已经到这里就结束了,不过一般在生产环境中 备份的文件一般会被按时间顺序打成包,并且利用脚本和crontab定时任务来实现特定文件的定时备份。
转载地址:http://hoqmb.baihongyu.com/