CentOS 6.3 Rsync文件同步
2013-10-23 23:43
274 查看
一、服务端配置
1.安装
yum
install rsync xinetd
2.编辑配置文件
在/etc目录下创建一个rsyncd的目录
mkdir
/etc/rsyncd
创建rsyncd.conf
,这是rsync服务器的配置文件
touch
/etc/rsyncd/rsyncd.conf
创建rsyncd.secrets
,这是用户密码文件
touch
/etc/rsyncd/rsyncd.secrets
为了密码的安全性,把权限设为600
chmod 600
/etc/rsyncd/rsyncd.secrets
创建rsyncd.motd文件,这是定义服务器信息的文件
touch
/etc/rsyncd/rsyncd.motd
syncd.conf文件内容:
pid file
=/var/run/rsyncd.pid
port=873
address=192.168.1.250
#uid = nobody
#gid = nobody
uid=root
gid=root
use chroot=yes
read only=yes
#limit access to private LANs
hosts allow=192.168.1.0/255.255.255.0
hosts deny=*
max connections=5
motd file =/etc/rsyncd/rsyncd.motd
#This will give you a separate log file
#log file = /var/log/rsync.log
#This will log every file transferred - up to 85,000+ per
user, per sync
#transfer logging = yes
log format=%t %a %m %f %b
syslog facility=local3
timeout =300
[ftphome]
path=/opt/ftp/
list=yes
#ignore errors
auth users =sunny
secrets file =/etc/rsyncd/rsyncd.secrets
comment =ftphome
exclude =upload/
[svn]
path =/opt/svn
list=no
#ignore errors
comment = svn
auth users =sunny
secrets file = /etc/rsyncd/rsyncd.secrets
密码文件:/etc/rsyncd/rsyncd.secrets的内容
user:password
rsyncd.motd 文件;
#定义rysnc
服务器信息,也就是客户端登录显示的信
+++++++++++++++++++++++++++
+ welcome rsync 2013
+
+++++++++++++++++++++++++++
启动rsync服务:
/usr/bin/rsync --daemon
--config=/etc/rsyncd/rsyncd.conf
客户端配置:
1.安装rsync
2.执行同步
rsync -vazu
--progress user@192.168.1.250::ftp
/home/sunny/rsync/ftp
3.客户端自动同步
crontab -e
加入如下代码:
10 0 * * * rsync
-avzP --delete
--password-file=rsync.password
user@192.168.1.250::ftp
/home/sunny/rsync/ftp
表示每天0点10分执行同步
附windows局域网备份同步脚本
#mysql数据库备份
mysqldump
-uroot -p123456789 -R store >
E:\bak\�te:~0,10%store.sql
del
e:\bak\store.zip
#压缩
c:\zip.exe -j e:/bak/store.zip
e:/bak/�te:~0,10%store.sql
if exist
"c:\lock.db" exit
ping -n 1
127.0.0.1>lock.db
net use y: \\192.168.1.20\d$
"12345" /user:"admin"
xcopy /e /d
/y /c e:\bak\file\* y:\bak\file\
xcopy /e /d
/y /c e:\bak\store.zip y:\bak\sql\
ping -n 1
127.0.0.1>null
del c:\lock.db
1.安装
yum
install rsync xinetd
2.编辑配置文件
在/etc目录下创建一个rsyncd的目录
mkdir
/etc/rsyncd
创建rsyncd.conf
,这是rsync服务器的配置文件
touch
/etc/rsyncd/rsyncd.conf
创建rsyncd.secrets
,这是用户密码文件
touch
/etc/rsyncd/rsyncd.secrets
为了密码的安全性,把权限设为600
chmod 600
/etc/rsyncd/rsyncd.secrets
创建rsyncd.motd文件,这是定义服务器信息的文件
touch
/etc/rsyncd/rsyncd.motd
syncd.conf文件内容:
pid file
=/var/run/rsyncd.pid
port=873
address=192.168.1.250
#uid = nobody
#gid = nobody
uid=root
gid=root
use chroot=yes
read only=yes
#limit access to private LANs
hosts allow=192.168.1.0/255.255.255.0
hosts deny=*
max connections=5
motd file =/etc/rsyncd/rsyncd.motd
#This will give you a separate log file
#log file = /var/log/rsync.log
#This will log every file transferred - up to 85,000+ per
user, per sync
#transfer logging = yes
log format=%t %a %m %f %b
syslog facility=local3
timeout =300
[ftphome]
path=/opt/ftp/
list=yes
#ignore errors
auth users =sunny
secrets file =/etc/rsyncd/rsyncd.secrets
comment =ftphome
exclude =upload/
[svn]
path =/opt/svn
list=no
#ignore errors
comment = svn
auth users =sunny
secrets file = /etc/rsyncd/rsyncd.secrets
密码文件:/etc/rsyncd/rsyncd.secrets的内容
user:password
rsyncd.motd 文件;
#定义rysnc
服务器信息,也就是客户端登录显示的信
+++++++++++++++++++++++++++
+ welcome rsync 2013
+
+++++++++++++++++++++++++++
启动rsync服务:
/usr/bin/rsync --daemon
--config=/etc/rsyncd/rsyncd.conf
客户端配置:
1.安装rsync
2.执行同步
rsync -vazu
--progress user@192.168.1.250::ftp
/home/sunny/rsync/ftp
3.客户端自动同步
crontab -e
加入如下代码:
10 0 * * * rsync
-avzP --delete
--password-file=rsync.password
user@192.168.1.250::ftp
/home/sunny/rsync/ftp
表示每天0点10分执行同步
附windows局域网备份同步脚本
#mysql数据库备份
mysqldump
-uroot -p123456789 -R store >
E:\bak\�te:~0,10%store.sql
del
e:\bak\store.zip
#压缩
c:\zip.exe -j e:/bak/store.zip
e:/bak/�te:~0,10%store.sql
if exist
"c:\lock.db" exit
ping -n 1
127.0.0.1>lock.db
net use y: \\192.168.1.20\d$
"12345" /user:"admin"
xcopy /e /d
/y /c e:\bak\file\* y:\bak\file\
xcopy /e /d
/y /c e:\bak\store.zip y:\bak\sql\
ping -n 1
127.0.0.1>null
del c:\lock.db
相关文章推荐
- [sersync+rsync] centos6.5 远程文件同步部署记录
- CentOS下rsync服务器安装与配置-数据同步-文件增量备份
- centos6.5 rsync+inotify实现服务器之间文件实时同步
- [sersync+rsync] centos6.5 远程文件同步部署记录
- CentOS 6.3_ RSync实现文件定时备份同步配置与使用
- centos下inotify结合rsync实时同步文件
- Centos 6.5 rsync+inotify 两台服务器文件实时同步
- Centos rsync文件同步配置步骤分享
- centos6.5 rsync+inotify实现服务器之间文件实时同步
- 【Linux】rsync同步文件 & 程序自启动
- CentOS 5.4 rsync+inotify配置触发式(实时)文件远程同步
- CentOS利用inotify+rsync实现文件同步
- CentOS 6.x 7.x中用rsync远程同步文件
- CentOS系统rsync文件同步 安装配置
- Centos rsync文件同步配置
- CentOS5.8 x86_64下配置rsync+inotify即时同步文件
- CentOS安装和配置Rsync进行文件同步
- Centos 的inotify和rsync文件实时同步
- CentOS 6.3 配置 yum
- CentOS 7.2 部署Rsync + Lsyncd服务实现文件实时同步/备份 (三)