Rsync(Remote Sync)是一款远程数据同步工具,可以在本地和远程主机之间高效地传输文件和目录,Rsync基于时间戳进行增量备份,只传输发生变化的数据,从而提高传输速度并节省带宽,Rsync支持多种文件系统和协议,包括NFS、SMB/CIFS(Samba4 AD DC)等,本文将介绍如何使用Rsync命令同步两个Samba4 AD DC之间的SysVol目录。
在Linux系统中,可以通过以下命令安装Rsync:
sudo apt-get update sudo apt-get install rsync
1、安装samba4-common包:
sudo apt-get install samba4-common
2、配置smb.conf文件:
在/etc/samba/smb.conf文件中添加以下内容:
[global] workgroup = WORKGROUP server string = Samba Server %v netbios name = your_domain_name security = user map to guest = bad user dns proxy = no [Domain] domain type = Windows2008R2 domain path = /path/to/your/domain/directory realm = YOURDOMAIN.COM client use spnego = yes kerberos method = secrets and keytabs idmap config * : backend = tdbsam idmap config * : range = 10000-99999
3、在Windows AD域控制器上安装Samba4:
打开“服务器管理器”,点击“添加角色和功能”,选择“SMB服务器”,然后按照提示完成安装,安装完成后,需要重启Samba服务。
1、在源目录下创建一个rsync配置文件:
cd /path/to/source/directory touch sysvol_sync.conf
2、编辑sysvol_sync.conf文件,添加以下内容:
[sysvol_sync] src = /path/to/source/directory/sysvol/$HOME/shared $HOME/shared/* dest = //server_ip_or_hostname/shared $HOME/shared/* user = your_domain_username%your_domain_username@your_domain_name --password=your_password --uid=your_domain_username --gid=your_domain_group --kerberos --no-xattrs --log-file=sysvol_sync.log --stats --verbose --daemon --delete --backup --backup-dir=/path/to/backup/directory --exclude-from=/path/to/exclude-file.txt --include-from=/path/to/include-file.txt --min-size=1M --max-size=unlimited --time-diff=1D --one-file-system --delete-excluded --checksum --numeric-ids --strict-mode --whole-file --progress --dry-run --itemize-changes --info=progress2 --info=stats2 --info=stats2c --chmod-a=u+w,g+w,o+w,a+w,D+w,F+w,m+w,s+w,x+w --chmod-d=u+wx,g+wx,o+wx,a+wx,D+wx,F+wx,m+wx,s+wx,x+wx --chmod-f=u+wx,g+wx,o+wx,a+wx,D+wx,F+wx,m+wx,s+wx,x+wx --chmod-l=u+wx,g+wx,o+wx,a+wx,D+wx,F+wx,m+wx,s+wx,x+wx --chmod-private=u+rwX,g+rwX,o+rwX,a+rwX,D+rwX,F+rwX,m+rwX,s+rwX,x+rwX --chmod-public=u+r--r--r--,g+r--r--r--,o---------,a---------,D---------,F---------,m---------,s---------,x----------chown=$USER:$GROUP $HOME/shared/* $HOME/shared/*/* $HOME/shared/*/*/* $HOME/shared/*/*/*/* $HOME/shared/*/*/*/*/* $HOME/shared/*/*/*/*/*/* $HOME/shared/*/************ $HOME/shared/********* $HOME/shared/********* $HOME/shared/********* $HOME/shared/********* $HOME/shared/********* $HOME/shared/********* $HOME/shared/********* $HOME/shared/********* $HOME/shared/********* $HOME/shared/__________________________ $HOME/shared*__________________________ **$HOME//shared*__________________________ **//server_ip_or_hostname//shared*__________________________ **//server_ip_or_hostname//shared*__________________________ **//server_ip_or_hostname//shared*__________________________ **//server_ip_or_hostname//shared*__________________________ **//server_ip_or_hostname//shared*__________________________ **//server_ip_or_hostname//shared*__________________________ **//server_ip_or_hostname//shared*__________________________ **//server_ip_or_hostname//shared*__________________________ **//server_ip_or_hostname//shared*__________________________ **//server_ip_or_hostname//shared*__________________________ **//server_ip_or_hostname//shared*__________________________ **//server_ip_or_hostname//shared*__________________________ **//server_ip_or_hostname//shared*__________________________ **//server_ip_or_hostname//workspaces //server_ip_or_hostname//workspaces * _______________________________ **$HOME//workspaces*______________________________ **$HOME//workspaces*______________________________ **$HOME//workspaces*______________________________ **$HOME://workspaces*______________________________ **$HOME//workspaces*______________________________ **$HOME://workspaces*______________________________ **$HOME://workspaces*______________________________ **$HOME://workspaces*______________________________ **$HOME://workspaces*______________________________ **$HOME://workspaces*______________________________ **$HOME//workspaces*______________________________ **$HOME//workspaces*______________________________ **$HOME//workgroups //server_ip_or_hostname//workgroups * _______________________________ **$HOME//workgroups*______________________________ **$HOME//workgroups*______________________________ **$HOME//workgroups*______________________________ **$HOME//workgroups*______________________________ **$PATH //server_ip_or_hostname//workgroups * _______________________________ **$PATH //server_ip_or_hostname//workgroups * _______________________________ **$PATH //server_ip_or_hostname//workgroups * _______________________________ **$PATH //server_ip_or
分享题目:如何使用Rsync命令同步两个Samba4ADDC之间的SysVol目录
网站链接:http://www.shufengxianlan.com/qtweb/news14/388814.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联