I'm using rsync with the --files-from option to copy a list of directories from a networked drive to my desktop. In this case I want to copy all directories named tennis
or football
(case insensitive). Though the directories exit, and I can cp -a
all of them, the rsync command doesn't seem to be able to see them!
Here's the rsync command I'm trying to use:
rsync --recursive --files-from=<(find /Volumes/GroupFolders -iname '*tennis*' -o -iname '*football*' | sed 's/ /\\ /g') / ./Desktop/new_folder/
And I get this error:
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]
Here's the structure of the directories on the networked drive:
|-- 2020
| |-- October
| | |-- Tennis
| | |-- Squash
| | |-- Yoga
| | |-- Running
| | |-- Bowling
| | `-- Shotput
| `-- September
| `-- Squash
`-- 2021
|-- January
| |-- Racketball
| |-- Squash
| |-- Swimming
| |-- Handball
| |-- Baseball
| |-- Basketball
| `-- Yoga
CodePudding user response:
I've managed to solve this myself ...
rsync --recursive --files-from=<(find /Volumes/GroupFolders -iname 'tennis' -o -iname 'football') / /Users/myusername/Desktop/new_folder/