0

使用rsync备份


前面说过使用ssh-keygen,实现免密码登陆linux,实现免密码登陆linux ,rsync也能使用ssh协议!

使用ssh-keygen 免密码登陆后,刚好可以用rsync来备份数据 ,写个脚本或者直接放进crontab就能自动备份了。 

参考: rsync的参数

-v :详细模式输出。
-z :对备份的文件在传输时进行压缩处理。
-r :对子目录异地归模式处理。


-t :保持文件的时间信息。
-o :保持文件的属主信息。
-p :保持文件的权限。
-g :保持文件的属组信息。
–delete :删除那些DST中SRC没有的文件,保持备份机和服务器的备份文件真正同步。
-e ssh :表示rsync通过ssh进行。

example

rsync -zvrtopg -e ssh root@10.1.1.2:/var/www/ /root/backup/

我猜~这些文章你可能也感兴趣

暂时没有留言..

给我留言:

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word