AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 824167
Accepted
Nic Nilov
Nic Nilov
Asked: 2017-01-05 08:46:52 +0800 CST2017-01-05 08:46:52 +0800 CST 2017-01-05 08:46:52 +0800 CST

sshfs 上的 Rsync 跳过以下划线开头的文件名

  • 772

我正在尝试将目录树从 OS X (10.11) 同步到 Ubuntu 14.04。虽然大多数文件都可以正常传输,但名称以_(下划线)开头的文件却不能。

这是我使用的命令:

rsync -rtvh --progress ~/Pictures/processed/ ~/mnt/processed/

以及输出示例:

sending incremental file list
_MG_7425.jpg
      4.66M 100%  169.79MB/s    0:00:00 (xfr#1, to-chk=58/60)
_MG_7427.jpg
      6.59M 100%  103.07MB/s    0:00:00 (xfr#2, to-chk=57/60)
...
rsync: mkstemp "/Users/user/mnt/processed/._MG_7425.jpg.0cAYb3" failed: No such file or directory (2)
rsync: mkstemp "/Users/user/mnt/processed/._MG_7427.jpg.5Gw1vD" failed: No such file or directory (2)

sent 306.24M bytes  received 9.46K bytes  122.50M bytes/sec
total size is 306.17M  speedup is 1.00
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1249) [sender=3.1.2]

我的 rsync 是从自制软件安装的,版本信息:

rsync  version 3.1.2  protocol version 31
Copyright (C) 1996-2015 by Andrew Tridgell, Wayne Davison, and others.
Web site: http://rsync.samba.org/
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes, no prealloc, file-flags

使用以下方式安装远程位置sshfs:

sshfs -o idmap=user username@hostname:/some/path ~/mnt -o auto_cache,reconnect,defer_permissions,noappledouble

使用命令复制跳过的文件之一cp成功。我尝试添加没有效果的选项--iconv=utf-8-mac,utf-8。--include '_*'

我究竟做错了什么?

synchronization ubuntu mac-osx rsync sshfs
  • 1 1 个回答
  • 710 Views

1 个回答

  • Voted
  1. Best Answer
    Nic Nilov
    2017-01-05T11:52:08+08:002017-01-05T11:52:08+08:00

    事实证明,罪魁祸首是在sshfs旗帜中。noappledouble我用来删除文件的标志.DS_Store实际上干扰了rsync的工作。

    从sshfs 挂载选项文档:

    noappledouble

    此选项使 osxfuse 拒绝对 Apple Double ( ._) 文件和.DS_Store文件的所有类型的访问。任何现有文件都将变得明显不存在。将不允许创建符合条件的新文件。

    正如它所指出的,该选项还与._名称前缀有关,这正是rsync其临时文件所使用的:

    rsync: mkstemp "/Users/user/mnt/processed/._MG_7425.jpg.0cAYb3" failed: No such file or directory (2)
    

    因此,在mkstemp创建临时文件时,sshfs会干扰并阻止它的创建。

    noappledouble从安装命令中删除选项sshfs修复了问题并且_*文件已正常传输。

    感谢@Halfgaar 为我指明了正确的方向。

    • 4

相关问题

  • 文件复制到分支机构

  • 在本地同步 FTP 文件夹

  • 在 Windows Server 环境中跨 LAN 或 FTP 自动同步/备份文件?

  • 网络文件同步工具

  • 允许跨平台同步的密码管理器[关闭]

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve