f++++++++++ 在 rsync 日志中是什么意思? [英] What does f+++++++++ mean in rsync logs?

查看:25
本文介绍了f++++++++++ 在 rsync 日志中是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 rsync 来备份我的服务器文件,我有两个问题:

  1. 在此过程中,我需要停止并再次启动 rsync.
    rsync 会从它停止的点开始还是从头开始?

  2. 在日志文件中,我看到 "f++++++++++".这是什么意思?

例如:

2010/12/21 08:28:37 [4537] >f.st...... iddd/logs/website-production-access_log2010/12/21 08:29:11 [4537] >f.st...... iddd/web/website/production/shared/log/production.log2010/12/21 08:29:14 [4537] .d..t...... iddd/web/website/production/shared/sessions/2010/12/21 08:29:14 [4537] >f+++++++++ iddd/web/website/production/shared/sessions/ruby_sess.017a771cc19b18cd2010/12/21 08:29:14 [4537] >f+++++++++ iddd/web/website/production/shared/sessions/ruby_sess.01eade9d317ca79a

解决方案

让我们来看看 rsync 如何工作并更好地理解神秘的结果行:

1 - rsync 的一个巨大优势是,在中断之后,它可以顺利地继续运行.

下一次 rsync 调用将不会再次传输已经传输的文件,如果它们在此期间没有更改.但是它会从头开始再次检查所有文件以找出原因,因为它不知道它已被中断.

2 - 每个字符都是一个可以翻译的代码,如果您阅读 man rsync

中的 -i, --itemize-changes 部分

从问题中解码示例日志文件:

>f.st......

>- 物品已收到f - 它是一个普通文件s - 文件大小不同t - 时间戳不同

.d..t......

<预><代码>.- 项目没有被更新(虽然它可能有属性正在修改)d - 它是一个目录t - 时间戳不同

>f++++++++++

>- 物品已收到f - 普通文件+++++++++ - 这是一个新创建的项目

<小时>

rsync 手册页的相关部分:

-i, --itemize-changes

请求对每个文件所做的更改的简单逐项列表,包括属性更改.这与指定 --out-format='%i %n%L' 完全相同.如果重复该选项,也将输出未更改的文件,但前提是接收的 rsync 至少为 2.6.7 版(您可以将 -vv 用于旧版本的 rsync,但这也会打开其他详细信息的输出-圣人).

%i"转义有一个 11 个字母长的神秘输出.一般格式就像字符串 YXcstpoguax,其中 Y 替换为正在执行的更新类型,X 替换为文件类型,其他字母表示如果正在修改它们可能会输出的属性.

替换 Y 的更新类型如下:

  • A < 表示正在将文件传输到远程主机(已发送).
  • A > 表示文件正在传输到本地主机(已接收).
  • A c 表示该项目正在发生本地更改/创建(例如创建目录或更改符号链接等).
  • A h 表示该项目是到另一个项目的硬链接(需要 --hard-links).
  • A . 表示该项目未更新(尽管它可能具有正在修改的属性).
  • A * 表示逐项输出区域的其余部分包含一条消息(例如删除").

替换 X 的文件类型是:f 表示文件,d 表示目录,L 表示符号链接,D 表示设备,S 表示特殊文件(例如命名套接字和 fifos).

上面字符串中的其他字母是当项目的关联属性正在更新或."时将输出的实际字母.因为没有变化.三个例外是:(1) 新创建的项目用+"替换每个字母,(2) 相同的项目用空格替换点,以及 (3) 未知属性用?"替换每个字母.(在与较旧的 rsync 交谈时可能会发生这种情况).

每个字母关联的属性如下:

  • A c 表示常规文件具有不同的校验和(需要 --checksum)或符号链接、设备或特殊文件具有更改的值.请注意,如果您将文件发送到 3.0.1 之前的 rsync,则此更改标志将仅用于校验和不同的常规文件.
  • A s 表示常规文件的大小不同,将通过文件传输进行更新.
  • A t 表示修改时间不同,正在更新为发送者的值(需要 --times).T 的替代值意味着修改时间将设置为传输时间,当文件/符号链接/设备在没有 --times 的情况下更新以及符号链接更改且接收器无法设置其时间时,就会发生这种情况.(注意:当使用 rsync 3.0.0 客户端时,您可能会看到 s 标志与 t 组合在一起,而不是此时间设置失败的正确 T 标志.)
  • A p 表示权限不同并且正在更新为发件人的值(需要 --perms).
  • o 表示所有者不同,并且正在更新为发送者的值(需要 --owner 和超级用户权限).
  • A g 表示组不同并且正在更新为发送者的值(需要 --group 和设置组的权限).
  • u 槽保留供将来使用.
  • a 表示 ACL 信息已更改.
  • x 表示扩展的属性信息发生了变化.

另一个输出是可能的:删除文件时,%i"将为每个被删除的项目输出字符串*deleting"(假设您正在与一个足够近的 rsync 交谈,它记录删除而不是将它们作为详细消息输出).

I'm using rsync to make a backup of my server files, and I have two questions:

  1. In the middle of the process I need to stop and start rsync again.
    Will rsync start from the point where it stopped or it will restart from the beginning?

  2. In the log files I see "f+++++++++". What does it mean?

e.g.:

2010/12/21 08:28:37 [4537] >f.st...... iddd/logs/website-production-access_log
2010/12/21 08:29:11 [4537] >f.st...... iddd/web/website/production/shared/log/production.log
2010/12/21 08:29:14 [4537] .d..t...... iddd/web/website/production/shared/sessions/
2010/12/21 08:29:14 [4537] >f+++++++++ iddd/web/website/production/shared/sessions/ruby_sess.017a771cc19b18cd
2010/12/21 08:29:14 [4537] >f+++++++++ iddd/web/website/production/shared/sessions/ruby_sess.01eade9d317ca79a

解决方案

Let's take a look at how rsync works and better understand the cryptic result lines:

1 - A huge advantage of rsync is that after an interruption the next time it continues smoothly.

The next rsync invocation will not transfer the files again, that it had already transferred, if they were not changed in the meantime. But it will start checking all the files again from the beginning to find out, as it is not aware that it had been interrupted.

2 - Each character is a code that can be translated if you read the section for -i, --itemize-changes in man rsync

Decoding your example log file from the question:

>f.st......

> - the item is received
f - it is a regular file
s - the file size is different
t - the time stamp is different

.d..t......

. - the item is not being updated (though it might have attributes 
    that are being modified)
d - it is a directory
t - the time stamp is different

>f+++++++++

> - the item is received
f - a regular file
+++++++++ - this is a newly created item


The relevant part of the rsync man page:

-i, --itemize-changes

Requests a simple itemized list of the changes that are being made to each file, including attribute changes. This is exactly the same as specifying --out-format='%i %n%L'. If you repeat the option, unchanged files will also be output, but only if the receiving rsync is at least version 2.6.7 (you can use -vv with older versions of rsync, but that also turns on the output of other verbose mes- sages).

The "%i" escape has a cryptic output that is 11 letters long. The general format is like the string YXcstpoguax, where Y is replaced by the type of update being done, X is replaced by the file-type, and the other letters represent attributes that may be output if they are being modified.

The update types that replace the Y are as follows:

  • A < means that a file is being transferred to the remote host (sent).
  • A > means that a file is being transferred to the local host (received).
  • A c means that a local change/creation is occurring for the item (such as the creation of a directory or the changing of a symlink, etc.).
  • A h means that the item is a hard link to another item (requires --hard-links).
  • A . means that the item is not being updated (though it might have attributes that are being modified).
  • A * means that the rest of the itemized-output area contains a message (e.g. "deleting").

The file-types that replace the X are: f for a file, a d for a directory, an L for a symlink, a D for a device, and a S for a special file (e.g. named sockets and fifos).

The other letters in the string above are the actual letters that will be output if the associated attribute for the item is being updated or a "." for no change. Three exceptions to this are: (1) a newly created item replaces each letter with a "+", (2) an identical item replaces the dots with spaces, and (3) an unknown attribute replaces each letter with a "?" (this can happen when talking to an older rsync).

The attribute that is associated with each letter is as follows:

  • A c means either that a regular file has a different checksum (requires --checksum) or that a symlink, device, or special file has a changed value. Note that if you are sending files to an rsync prior to 3.0.1, this change flag will be present only for checksum-differing regular files.
  • A s means the size of a regular file is different and will be updated by the file transfer.
  • A t means the modification time is different and is being updated to the sender’s value (requires --times). An alternate value of T means that the modification time will be set to the transfer time, which happens when a file/symlink/device is updated without --times and when a symlink is changed and the receiver can’t set its time. (Note: when using an rsync 3.0.0 client, you might see the s flag combined with t instead of the proper T flag for this time-setting failure.)
  • A p means the permissions are different and are being updated to the sender’s value (requires --perms).
  • An o means the owner is different and is being updated to the sender’s value (requires --owner and super-user privileges).
  • A g means the group is different and is being updated to the sender’s value (requires --group and the authority to set the group).
  • The u slot is reserved for future use.
  • The a means that the ACL information changed.
  • The x means that the extended attribute information changed.

One other output is possible: when deleting files, the "%i" will output the string "*deleting" for each item that is being removed (assuming that you are talking to a recent enough rsync that it logs deletions instead of outputting them as a verbose message).

这篇关于f++++++++++ 在 rsync 日志中是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆