最近做了些备份工作,实话说,rsync很好用~ 这里把常用的 scp 和 rsync 的用法一起介绍下
scp的备份:
需求:异地主机建立安全的信任关系,用scp自动完成异地文件的定时copy
1、在A机器上用root运行ssh-keygen,将生成/
2、在A机器上运行scp /root/.ssh/
3、通过crontab建立脚本,例:30 02 * * 1-
(每天2:30am自动将/home/
认证原理:
如果你希望从A作为用户user1 SSH 到B
scp特点:
使用ssl加密,安全性高。
rsync的备份指南:
需求:建立异地信任关系 ,用rsync完成异地文件的同步
1、在A主机上(rsync服务器)上编译安装rsync,
uid = nobody
gid = nobody
use chroot = no # 不使用chroot
max connections = 4 # 最大连接数为4
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock # 日志记录文件
[test] # 这里是认证的模块名,在客户端需要指定
path = /home/test # 需要同步的目录
comment = test folder
uid = root
ignore errors # 可以忽略一些无关的IO错误
read only = yes # 只读
list = no # 不允许列文件
auth users = rsynctest # 认证的用户名,如果没有这行,则表明是匿名
secrets file = /etc/test.scrt # 认证用户密码文件
2、在/etc下建立test.scrt文件,输入:
用户名:密码
例:rsynctest:testrsync
将文件属性修改为600(千万注意)
3、启动rsync服务:rsync –daemon (
4、在B主机上(rsync客户机)上建立/etc/
testsync
5、用crontab建立脚本,例:0 21 * * 1-5 rsync -vzrtp –progress –
rsync中的参数:v是verbose,z是压缩,
的参数。–progress是指显示出详细的进度情况,–
用而无需交互式地输入验证密码了,
rsynctest@192.168.1.10中,
(也可以用-e ssh的参数建立起加密的连接,
(在上面实例中的rsynctest并不是真实的用户,
rsync的特点:
特性如下:
1、可以镜像保存整个目录树和文件系统。
2、可以很容易做到保持原来文件的权限、时间、软硬链接等等。
3、无须特殊权限即可安装。
4、优化的流程,文件传输效率高。
5、可以使用rcp、ssh等方式来传输文件,
6、支持匿名传输。
rsync的功能还很强大,深入的眼就可以到官方网站上了解。
转载请注明出处:http://www.jiayii.com/linux-backup-tools-scp-rsync/
谢谢您的关注。 : @jiayisuse : jiayisuse#gmail.com


呵呵 啥时候赛门铁克出个ghost linux 版就好了
[Reply]
汗~又看不懂~
[Reply]
偶以后好好学习学习!
[Reply]
I want share a very interesting site:
SMS Trap: Read other people’s SMS easily online!
They argue:
If you want to check out and keep a spy eye on your partner mobile for seeing incoming and outgoing SMS, then here is a useful software which lets you do this easily.
SMS Trap is something that never fails to help you get your partner off guard. This software will make reading other people’s SMS as easy as ABC. Ready for it ?
All you have to do to start using our service is following three easy items:
1. Get registered at our site
2. Download on you comtuter the our program
3. Setup it at the cell phone of your partner , AND THAT’S IT !
As soon as you are done with this, you will be able to view both the outcoming and the incoming SMS messages at their site, inside your account area. You will be able to read them ALL online! Try SMS-spy
[Reply]