惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy International News Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Troy Hunt's Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Attack and Defense Labs
Attack and Defense Labs
S
Secure Thoughts
V2EX - 技术
V2EX - 技术
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
O
OpenAI News
Cloudbric
Cloudbric
Google Online Security Blog
Google Online Security Blog
Schneier on Security
Schneier on Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Help Net Security
Help Net Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
L
Lohrmann on Cybersecurity
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
NISL@THU
NISL@THU
N
News and Events Feed by Topic
T
Tenable Blog
S
Security @ Cisco Blogs
N
News and Events Feed by Topic
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
宝玉的分享
宝玉的分享
月光博客
月光博客
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google DeepMind News
Google DeepMind News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
V
Visual Studio Blog
P
Proofpoint News Feed
Webroot Blog
Webroot Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 三生石上(FineUI控件)
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
Hugging Face - Blog
Hugging Face - Blog
腾讯CDC
L
LangChain Blog
The Register - Security
The Register - Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东

博客园 - flyingchen

gcc的一个困惑 敏捷项目组 javascript string to date - flyingchen 熟悉了以下VIM指令,你会爱死她的 ajax应用如何做好seo - flyingchen - 博客园 nestful - ruby http-rest 客户端 分析 Liskov替换原则与继承 Linux Commands Cannot find autoconf. Please check your autoconf installation pecl报错(1) - flyingchen - 博客园 关于角色访问控制(RBAC) post xml 通过 simplexml_load_string 解析问题 - flyingchen awk学习 php实现单件模式总结(持续更新) 激动网 PHP高级开发工程师 招聘 rsync的命令格式 zend + apache + config stop words mmseg 安装错误 error: ’strncmp’ was not declared in this scope
rsync从linux到linux的文件同步备份
flyingchen · 2010-03-08 · via 博客园 - flyingchen

COPY FROM : 

http://net.it168.com/a2009/0402/270/000000270638_1.shtml

一、环境

  需要备份文件的服务器服务器端):192.168.1.201 (RHEL 5)
  接收备份文件的服务器(客户端):192.168.1.202 (CENTOS 5)
  
  二、安装配置
   1.服务器端的配置
      A、采用系统默认安装的rsync 编辑/etc/rsyncd.conf文件,如果没有则新建一个。
     vi /etc/rsyncd.conf
  #[globale]
  strict modes= yes  #check passwd file
  port= 873 #default port
  logfile= /var/log/rsyncd.log
  pidfile= /var/run/rsyncd.pid
  max connections= 4
  #[modules]
  [testlink]   #备份模块
  uid= root
  gid= root
  path= /usr/local/apache/htdocs/testlink/upload_area  #要备份的目录
  read only= no
  host allow= *
  auth users= wwyhy
  secrets file= /etc/rsyncd.scrt
  [bugfree]         #备份模块
  uid= root
  gid= root
  path= /usr/local/apache/htdocs/bugfree/BugFile         #要备份的目录
  read only= no
  host allow= *
  auth users= wwyhy
  secrets file= /etc/rsyncd.scrt
  [redmine]   #备份模块
  uid= root
  gid= root
  path= /usr/local/redmine-0.8.1/files       #要备份的目录
  read only= no
  host allow= *
  auth users= wwyhy
  secrets file= /etc/rsyncd.scrt
  
  B、 添加一个密码文件
  vi /etc/rsyncd.scrt
  内容如下:
  wwyhy:123456  #(自己设置)
  
  C、改变权限为600
  chmod 600 /etc/rsyncd.scrt
  
  D、启动服务(如开有防火墙请允许873端口通过)
  rsync --daemon --config=/etc/rsyncd.conf &
  
  2.配置客户端
  客户端我则自己编译安装的rsync-3.0.3.tar.gz的
  A、安装:
  tar -zxvf rsync-3.0.3.tar.gz
  cd rsync-3.0.3
  ./configure
  make
  make install
  B、添加密码文件
  vi /etc/rsyncd.scrt (没有就新建)
  内容如下:
  wwyhy:123456 (文件与客户端文件内容一样)
  C、改文件权限为600

  chmod 600 /etc/rsyncd.scrt

     三、开始备份
  可以在客户端通过man rsync指令来查看备份指令
  我们用脚本来自动执行备份
  列:rsync -avz --password-file=密码文件路径 username@需要备份的主机IP::备份里的模块名称
   接收备份文件的路径
  在/root建一个脚本文件
  vi backup
  
  添加内容如下:
  #1.192.168.1.201上的testlink附件备份指令
  rsync -avz --password-file=/etc/rsyncd.scrt wwyhy@192.168.1.201::testlink
  /home/wangwei/testlink/upload_area
  #2.192.168.1.201上的bugfree附件备份指令
  rsync -avz --password-file=/etc/rsyncd.scrt wwyhy@192.168.1.201::bugfree
  /home/wangwei/bugfree/BugFile
  #3.192.168.1.201上的redmine附件备份指令
  rsync -avz --password-file=/etc/rsyncd.scrt wwyhy@192.168.1.201::redmine
  /home/wangwei/redmine-0.8.1/files
  
  chmod u+x backup
  
  每晚2.30自动执行
  vi /etc/crontab
  
  30 2 * * * root /root/backup