If I want to sync txt files in every Test 3
directory only, how would I do that if the directory structure is:
/mnt/this/Test 3/dir/file1.txt
/mnt/Test 3/dir/file01.txt
/mnt/Test/Test 3/file2.txt
/mnt/that/Test 3/dir/file03.txt
/mnt/the other/stuff/good/Test 3/file-1.txt
I've tried:
rsync -rv --include 'Test 3/' --include '*.txt' --exclude '*' --exclude '/*' . /mnt/backup/Test\ 3/
rsync -rv --include '*/Test 3' --include '*.txt' --exclude '*' . /mnt/backup/Test\ 3/
rsync -rv --include '*Test 3*' --include '*.txt' --exclude '*' . /mnt/backup/Test\ 3/
None of which works of course.
…/Test 3
that aren't called*.txt
? Do you want to copy emptyTest 3
directories? Shouldsomewhere/Test 3/foo.txt
andelsewhere/Test 3/foo.txt
both map to/mnt/backup/Test 3/foo.txt
or should they map to/mnt/backup/Test 3/somewhere/Test 3/foo.txt
and/mnt/backup/Test 3/eksewhere/Test 3/foo.txt
respectively? – Gilles 'SO- stop being evil' Sep 18 '20 at 23:16Test 3
then? And do you want to put them all in the same place, or do you want to reproduce the directory structure? – Gilles 'SO- stop being evil' Nov 15 '20 at 15:58