Page 1 of 1

Filename filter in Sync rules

PostPosted: Mon Apr 02, 2018 10:47 am
by raykinsella
I've created a folder sync based on the basic sync recipe post below and it works great.

viewtopic.php?f=4&t=1593

I'd like to add a filter to exclude filenames that end with specific characters. That filter works separately but I can't figure out where to put it in the sync filter to make it work.

This is working for the sync but not the file exclusion:

Image

Re: Filename filter in Sync rules

PostPosted: Tue Apr 03, 2018 10:58 am
by Mr_Noodle
It won't work in this case as the Sync action is meant to sync a whole folder at a time.

Instead, you would have to create two separate rules. One to tell Hazel to go into subfolders (search in the manual as there's a chapter on it there) and one to copy the individual files. In the second rule is where you'd put any conditions to limit which files should be copied. Note that by going this route, though, you lose the ability to sync deletions (where a file deleted at the source is likewise removed from the destination).

Re: Filename filter in Sync rules

PostPosted: Tue Apr 03, 2018 10:59 am
by raykinsella
Thanks. So in order to keep a full sync including deletions, I won't be able to filter out some files?

Re: Filename filter in Sync rules

PostPosted: Tue Apr 03, 2018 11:00 am
by Mr_Noodle
That is correct.

Re: Filename filter in Sync rules

PostPosted: Wed Apr 04, 2018 5:00 pm
by raykinsella
If I change to a two step rules in order to filter out specific filenames, deleted files won't sync, but what about renames? Will those?

Thanks!

Re: Filename filter in Sync rules

PostPosted: Thu Apr 05, 2018 11:50 am
by Mr_Noodle
The file under the new name will be copied over but the file with the old name will remain at the destination.