-a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)
-r, --recursive recurse into directories
-l, --links copy symlinks as symlinks
-p, --perms preserve permissions
-t, --times preserve modification times
-g, --group preserve group
-o, --owner preserve owner (super-user only)
-D same as --devices --specials
--devices preserve device files (super-user only)
--specials preserve special files -H, --hard-links preserve hard links
-A, --acls preserve ACLs (implies -p)
-X, --xattrs preserve extended attributes -P same as --partial --progress
--partial
By default, rsync will delete any partially transferred file if the transfer is interrupted. In some circum‐
stances it is more desirable to keep partially transferred files. Using the --partial option tells rsync to keep
the partial file which should make a subsequent transfer of the rest of the file much faster.
断点续传
--progress
This option tells rsync to print information showing the progress of the transfer. This gives a bored user some‐
thing to watch. With a modern rsync this is the same as specifying --info=flist2,name,progress, but any
user-supplied settings for those info flags takes precedence (e.g. "--info=flist0 --progress").
显示传输进度 -v, --verbose
This option increases the amount of information the daemon logs during its startup phase. After the client con‐
nects, the daemon’s verbosity level will be controlled by the options that the client used and the "max ver‐
bosity" setting in the module’s config section.
输出详细信息 --delete
This tells rsync to delete extraneous files from the receiving side (ones that aren’t on the sending side), but
only for the directories that are being synchronized. 推荐用法:
rsync -aP --delete . /tmp/20180619/
rsync -av --delete --progress . /tmp//

[root@prdweb02 ~]# ll | grep tes
-rw-r--r-- 1 root root 139351040 Dec 25 11:48 kubernetes-dashboard-amd64.tgz
drwxr-xr-x 3 root root 92 Feb 20 18:06 test_compose

源目录后加/则只会把这个目录下的内容复制过去

[root@prdweb02 ~]# rsync -aP  --delete test_compose/ /tmp/20180619/

源目录后不加/则会把这个目录本身也复制过去

[root@prdweb02 ~]# rsync -aP  --delete test_compose /tmp/20180619/

rsync同步目录的更多相关文章

  1. 使用rsync同步目录

    本文描述了linux下使用rsync单向同步两个机器目录的问题. 使用rsync同步后可以保持目录的一致性(含删除操作). 数据同步方式 从主机拉数据 备机上启动的流程 同步命令: rsync -av ...

  2. rsync同步目录及同步文件

    最简单的只读同步工作. 一,服务端的配置 1,安装rsync(阿里云默认已有此程序) 略 2,生成文件rsyncd.conf,内容如下: #secrets file = /etc/rsyncd.sec ...

  3. [CentOS] rsync同步目录进行备份文件

    操作不难,网上一堆.这里列几个 CentOS7 参考地址: https://www.server-world.info/en/note?os=CentOS_7&p=rsync Copy fil ...

  4. 运维工作中常用到的几个rsync同步命令

    作为一个运维工程师,经常可能会面对几十台.几百台甚至上千台服务器,除了批量操作外,环境同步.数据同步也是必不可少的技能.说到“同步”,不得不提的利器就是rsync. 下面结合本人近几年运维工作中对这一 ...

  5. rsync+inotify 实现资源服务器的同步目录下的文件变化时,备份服务器的同步目录更新,以资源服务器为准,去同步其他客户端

    测试环境: 资源服务器(主服务器):192.168.200.95 备份服务器(客户端):192.168.200.89 同步目录:/etc/test 同步时使用的用户名hadoop密码12345 实验目 ...

  6. Linux使用rsync客户端与服务端同步目录进行备份

    一.服务端设置 1. 修改 server 端配置 # vi /etc/rsyncd.conf 修改: uid = nobody # 该选项指定当该模块传输文件时守护进程应该具有的uid.默认值为&qu ...

  7. rsync实现目录同步

    rsync rsync是linux系统下的数据镜像备份工具.使用快速增量备份工具Remote Sync可以远程同步,支持本地复制,或者与其他SSH.rsync主机同步. 外文名 rsync 全     ...

  8. 使用rsync, 向另外一台服务器同步目录和文件的脚本

    #!/bin/bash #亚特兰蒂斯-同步目录#定时任务ini_file="/usr/local/sunlight/conf/rsync-file.ini"target_ip=&q ...

  9. puppet使用rsync模块同步目录和文件

    puppet使用rsync模块同步目录和文件 2013-09-23 14:28:57 分类: LINUX 环境说明: OS :    CentOS5.4                         ...

随机推荐

  1. DG备库,实时应用如何判断,MR进程,及MRP应用归档,三种情况的查询及验证

    本篇文档学习,DG备库,实时应用如何判断,MR进程,及MRP应用归档,三种情况的查询及验证 1.取消MRP进程 备库查询进程状态select process,client_process,sequen ...

  2. python time 时间处理

    a='2018-03-26 17:20:11' >>> print time.strftime("%Y%m%d", a)Traceback (most recen ...

  3. 设置 SSH 通过密钥登录

    我们一般使用 PuTTY 等 SSH 客户端来远程管理 Linux 服务器.但是,一般的密码方式登录,容易有密码被暴力破解的问题.所以,一般我们会将 SSH 的端口设置为默认的 22 以外的端口,或者 ...

  4. 将数据存入mysql中

    import pymysql import warnings # 忽略警告 warnings.filterwarnings("ignore") # 连接数据库 db = pymys ...

  5. EasyUI datagrid combox onchange 五

    $("#sTwo").combobox({ onChange: function (n,o) { n改变后,o改变前 }

  6. 树莓派ssh服务

    从官网下载的镜像更新raspberry pi 3 B,但默认是不支持SSH的,即不可外部通过SSH登陆到板子里. 解决办法很简单,在SD卡的根目录下创建一个"ssh"的文件夹即可.

  7. hdu4549 M斐波那契数列 矩阵快速幂+快速幂

    M斐波那契数列F[n]是一种整数数列,它的定义如下: F[0] = aF[1] = bF[n] = F[n-1] * F[n-2] ( n > 1 ) 现在给出a, b, n,你能求出F[n]的 ...

  8. mac电脑读写NTFS格式的移动硬盘命令

    diskutil info /Volumes/SAMSUNG | grep UUID echo "UUID=38EBE5E4-016F-44B7-9D55-BB4AF6DC3E1D none ...

  9. <------------------字符流--------------------->

    FileWriter 字符输出流: 方法: 写入:write 刷新:flush public static void main(String[] args) throws IOException { ...

  10. java System.arraycopy()

    package study.stage2; import java.util.Arrays; /** * Created by Sandy.Liu on 2017/7/19. */public cla ...