【问题标题】:how to suppress cpio warning: file on disk is not older; skipping如何抑制 cpio 警告:磁盘上的文件不旧;跳过
【发布时间】:2012-09-08 18:41:14
【问题描述】:

我使用 cpio (find . | cpio -pdm destination) 创建大目录的卷影副本

升级到 Mountain Lion 后,cpio 现在警告我它没有复制的每个文件,即cpio: ./some-file: File on disk is not older; skipping.

我可以重定向stderr;但是,我确实想知道真正的错误,例如目的地已满。

cpio --quiet 没有帮助。

想法?

【问题讨论】:

    标签: macos command-line osx-mountain-lion


    【解决方案1】:

    这意味着您的目标文件比您的源文件更新。 这可能来自您机器上错误的当前时间。 如果确定要覆盖,可以使用-ucpio 开关: 来自https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/cpio.1.html

    -u  (i and p modes) Unconditionally overwrite existing files.  Ordinarily, an older file will not overwrite a newer file on disk.
    

    【讨论】:

    • 只复制较新的文件是使用 cpio 的重点。在 Leopard cpio 上,它会默默地忽略未更改的文件,但在 Mountain Lion 上,它会警告我每个文件。我想再次喜欢 Leopard 的行为。
    猜你喜欢
    • 2015-08-01
    • 1970-01-01
    • 2011-12-28
    • 2020-03-09
    • 2010-12-24
    • 2019-02-25
    • 2011-03-18
    • 1970-01-01
    相关资源
    最近更新 更多