1、rsync 不加参数传输文件。 2、-a,--archive:归档模式,递归传输和保存文件属性。 3、源文件与目标文件大小、时间属性一致。rsync -a / --archive 目标文件不会发生变化。 4、源文件和目标文件大小、时间属性不一致,rsync -a / --archive 目标文件会更新为源文件。 5、源文件与目标文件大小、时间属性一致。
[root@localhost ~]# rsync -azv /var/log/ /root/temp/sending incremental file list./btmpdnf.librepo.logdnf.logdnf.rpm.log...sssd/sssd_nss.logtuned/tuned/tuned.logsent 516,231 bytes received 629 bytes 1,033,720.00 bytes/sectotal size is 5,451,789 speedup is 10.55 1. 2. 3. 4. ...
实例二:使用rsync -a在同步期间保留时间戳 rsync命令的-a选项表示存档模式。-a选项递归同步、保留符号链接、保留权限、保留时间戳、保留所有者和组。 现在,执行以下命令,然后查看文件的时间: [root@localhost ~]# rsync -azv /var/log/ /root/temp/ sending incremental file list ./ btmp dnf.librepo.log d...
[root@xuexi ~]# rsync /etc/fstab /tmp将/etc/cron.d目录拷贝到/tmp下。[root@xuexi ~]# rsync -r /etc/cron.d /tmp该命令会在目标主机上创建/tmp/cron.d目录,并将/etc/cron.d/中的文件放入到/tmp/cron.d/目录中,也就是说默认情况下,是不会在目录路径下创建上层目录/etc的。将/etc/cron.d目...
1、rsync -a -b / --backup 备份文件,如目标目录没有同名文件则会创建一个备份文件,新创建的备份文件不会带 ~ 符号。 操作步骤: 1、按照国际惯例,首先还是要建立测试所需的框架。mkdir backups_ab 创建一个目标目录(备份目录)。 2、源目录沿用之前预设的 SRC目录框架,目录下有demo1.txt、demo2.txt 和 ...
2. 用rsync –a. 同步时间戳 rsync的-a选项是archive的意思,加了之后有以下作用: • 递归模式 • 同步软链接 • 同步权限 • 同步时间戳 • 同步属主和属组 现在,我们执行与例1一样的命令,不同的是使用-a选项。 $ rsync -azv /var/opt/installation/inventory/ /root/temp/building file list...
1、服务器A(主服务器) IP:192.168.1.144 2、服务器B(从服务器/备份服务器) IP:192.168.1.145 3、rsync默认TCP端口为873 4、实现服务器A→服务B(A服务文件同步至B服务器中) 服务器B #在服务器B上安装rsynccd /app/local wget http://rsync.samba.org/ftp/rsync/src/rsync-3.1.1.tar.gz ...
rsync -avP /source/directory/ /destination/directory/ 1. 限制传输速度 rsync -avz --bwlimit=500K /source/directory/ /destination/directory/ 1. 常见错误与处理方式 1. SSH连接失败 错误信息:ssh: connect to host remotehost port 22: Connection refused ...
复制代码代码如下:[root@localhost /]# rsync -azvr /home/aloft/ /backuphomedirbuilding file list ... done./.bash_logout.bash_profile.bashrcsent 514 bytes received 92 bytes 1212.00 bytes/sectotal size is 324 speedup is 0.53上面我们使用了-a选项,它保留了所有人和所属组、时间戳...
rsync是linux系统下的数据镜像备份工具——remote sync。一款快速增量备份工具 Remote Sync,远程同步 支持本地复制,或者与其他SSH、rsync主机同步。工具/原料 2台centos6.5的系统(安装好桌面)方法/步骤 1 首先准备好两台centos6.5的系统,将yum源搭建好,开启ssh服务。2 用远程管理软件secureCRT连接,方便操作,...