I try to sync to folders, but with exceptions made by tags. So I learned, that I need different commands to build up that job. First I create a file of excluded files, which have a tag in orange or red set.
Then I call rsync with this output file as the no-do-list. But the content of the file is an absolute file name, while rsync seems to need relative path.
This is what I already have (need local language for names!):
mdfind -onlyin . "kMDItemUserTags == 'Orange' || kMDItemUserTags == 'Rot'" > excluded.txt
And this is the one I need to get run:
rsync -avz --exclude-from "excluded.txt" source/ destination/
Any ideas?
Additional infos for better reading: Now with "sed", I get:
./Gruppe/A-Teens
./Gruppe/A-Teens/A - Teens - Mama Mia.mp3
./Gruppe/A-Teens/A - Teens - Super Trouper.mp3
Unfortunately this does not work. Again everything is copied. Actual statements:
cd /Users/serveruser/Desktop/fasttemp/temp/Unser/Songs
mdfind -onlyin . "kMDItemUserTags == 'Orange' || kMDItemUserTags == 'Rot'" | sed 's|/Users/serveruser/Desktop/fasttemp/temp/Unser/Songs|.|' > excluded.txt
rsync -avz --exclude-from "excluded.txt" /Users/serveruser/Desktop/fasttemp/temp/Unser/Songs/ /Users/serveruser/Desktop/fasttemp/temp/Unser/Backup/