rsync增量同步标志位详细解释
Posted felix-zp
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了rsync增量同步标志位详细解释相关的知识,希望对你有一定的参考价值。
rsync非常强大,下面是我用rsync做目录备份时用到的参数:
rsync -ruPi -plEt /home/op/photo/ /remote_backup/photo/ --dry-run
-r 循环目录
-u update模式,只同步更新过的
-P 等于--partial --progress,显示进度,并支持断点续传
-i 显示每个文件的同步细节,见下面--itemize-changes部分
-p 保留权限
-l 拷贝软链接(如果要拷贝链接指向的实际文件,用-L)
-E 保留执行权限
-t 保留修改时间
--delete 同步删除动作
其中,-i 显示每个文件的同步细节,见下面--itemize-changes部分
下面内容转自:stackoverflow
Explanation of each bit position and value in rsync‘s output:
YXcstpoguax path/to/file
|||||||||||
||||||||||╰- x: The extended attribute information changed
|||||||||╰-- a: The ACL information changed
||||||||╰--- u: The u slot is reserved for future use
|||||||╰---- g: Group is different
||||||╰----- o: Owner is different
|||||╰------ p: Permission are different
||||╰------- t: Modification time is different
|||╰-------- s: Size is different
||╰--------- c: Different checksum (for regular files), or
|| changed value (for symlinks, devices, and special files)
|╰---------- the file type:
| f: for a file,
| d: for a directory,
| L: for a symlink,
| D: for a device,
| S: for a special file (e.g. named sockets and fifos)
╰----------- the type of update being done::
<: file is being transferred to the remote host (sent)
>: file is being transferred to the local host (received)
c: local change/creation for the item, such as:
- the creation of a directory
- the changing of a symlink,
- etc.
h: the item is a hard link to another item (requires
--hard-links).
.: the item is not being updated (though it might have
attributes that are being modified)
*: means that the rest of the itemized-output area contains
a message (e.g. "deleting")
Some example output from rsync for various scenarios:
>f+++++++++ some/dir/new-file.txt
.f....og..x some/dir/existing-file-with-changed-owner-and-group.txt
.f........x some/dir/existing-file-with-changed-unnamed-attribute.txt
>f...p....x some/dir/existing-file-with-changed-permissions.txt
>f..t..g..x some/dir/existing-file-with-changed-time-and-group.txt
>f.s......x some/dir/existing-file-with-changed-size.txt
>f.st.....x some/dir/existing-file-with-changed-size-and-time-stamp.txt
cd+++++++++ some/dir/new-directory/
.d....og... some/dir/existing-directory-with-changed-owner-and-group/
.d..t...... some/dir/existing-directory-with-different-time-stamp/
以上是关于rsync增量同步标志位详细解释的主要内容,如果未能解决你的问题,请参考以下文章