-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. Django之模板层-继承

    模板语法:继承 Django模版引擎中最强大也是最复杂的部分就是模版继承了.模版继承可以让您创建一个基本的"骨架"模版,它包含您站点中的全部元素,并且可以定义能够被子模版覆盖的 b ...

  2. bootstrap 4 pull-right无效

    /********************************************************************** * bootstrap 4 pull-right无效 * ...

  3. 【计算机视觉】KCF算法

    code opencv3.3.1-contrib  ---- TrackerKCF.cpp opencv如何更新目标区域的过程: // calculate filter response if(par ...

  4. 使用Python中的log模块将loss输出到终端与保存到文件

    记得之前对深度学习中得loss输出,经常自己会将输出流重新定向到一个文件中, 比如 python main.py > & | tee log.txt 对于caffe这种c++框架而言,用 ...

  5. JAVA基础部分复习(一、8中基础类型,以及String相关内容)

    以下是关于java中8种基本类型的介绍说明: package cn.review.day01; /** * java基础复习,8种数据类型 * (byte,short,long,int,double, ...

  6. Python数据结构——栈的链表实现

    自定义链表实现栈的数据结构,代码如下: class Stack: def __init__(self): self._first = None def push(self,item): self._f ...

  7. 莫队算法 [国家集训队]小Z的袜子

    题目链接   洛古   https://www.luogu.org/problemnew/show/P1494 大概说下自己的理解 先来概率的计算公式   ∑C(2,f(i))  /  C(2,r−l ...

  8. Mybatis(四)

    参考网址如下: http://www.cnblogs.com/xdp-gacl/p/4264425.html 向大家推荐 博客园 孤傲苍狼 大哥的博客,东西写的有水平.小弟记录一下自己的学习历程,自勉 ...

  9. 如何查看你的VPS是什么虚拟化架构?

    使用virt-what即可了 CentOS安装 virt-what yum install virt-what Debian/ubuntu 安装 virt-what apt-get install v ...

  10. Python——xlsxwriter模块的使用

    xlsxwriter是用于制作Excel表格的 安装方法 40 wget https://pypi.python.org/packages/e4/63/e53deacc293c7fadf95b8404 ...