我使用rsync和--文件- from选项将目录列表从网络驱动器复制到我的桌面上。在本例中,我希望复制名为tennis
或football
的所有目录(大小写不敏感)。虽然目录退出,而且我可以cp -a
所有这些目录,但rsync命令似乎无法看到它们!
下面是我试图使用的rsync命令:
rsync --recursive --files-from=<(find /Volumes/GroupFolders -iname '*tennis*' -o -iname '*football*' | sed 's/ /\\ /g') / ./Desktop/new_folder/
我得到了一个错误:
rsync: link_stat "/Volumes/GroupFolders/2020/October/Tennis" failed: No such file or directory (2)
rsync error: some files could not be transferred (code 23) at /System/Volumes/Data/SWE/macOS/BuildRoots/38cf1d983f/Library/Caches/com.apple.xbs/Sources/rsync/rsync-55/rsync/main.c(996) [sender=2.6.9]
以下是网络驱动器上目录的结构:
|-- 2020
| |-- October
| | |-- Tennis
| | |-- Squash
| | |-- Yoga
| | |-- Running
| | |-- Bowling
| | `-- Shotput
| `-- September
| `-- Squash
`-- 2021
|-- January
| |-- Racketball
| |-- Squash
| |-- Swimming
| |-- Handball
| |-- Baseball
| |-- Basketball
| `-- Yoga
发布于 2021-10-25 13:39:37
我自己解决了这个问题..。
rsync -递归-文件-从=<(查找/卷/组文件夹-iname‘-o -iname’足球网球‘)//用户/myusername/桌面/新文件夹/
https://stackoverflow.com/questions/69634374
复制相似问题