Page 1 of 1

Sync folder structure but only changed files not full folder

PostPosted: Sun Jan 22, 2023 8:46 am
by logorrhoea
Hi

I'm trying to sync only the changes from folder A to folder B.

Let's say I have a structure like this:

Folder A
- file A.1
- file A.2
- Sub-folder AA
- file AA.1
- file AA.2
- file AA.3

If I modify file AA.1 within sub-folder AA, *all* the files in sub-folder AA get synced across, not just file AA.1. Is there any way around this?

I've read the page on Syncing Folders and used the template rule as well as tried variations on it. Reading that page, I was under the impression only changed files would be synced across but I'm guessing because a changed file changes the last modified date of the folder it's in, that makes Hazel thing the whole folder needs syncing.

Is there an easy way around this? TIA.

Re: Sync folder structure but only changed files not full fo

PostPosted: Mon Jan 23, 2023 11:01 am
by Mr_Noodle
Can you show evidence that it's syncing unnecessary files? Even if a folder is updated doesn't necessarily mean all the files in it are as well.

Re: Sync folder structure but only changed files not full fo

PostPosted: Mon Jan 23, 2023 1:20 pm
by logorrhoea
Here's what's happening. Hopefully you can follow the steps ok.

Edit: Can't get the image to appear inline, so here's the link: https://www.dropbox.com/s/5c2u55srpgb67 ... 20sync.png

Re: Sync folder structure but only changed files not full fo

PostPosted: Tue Jan 24, 2023 10:36 am
by Mr_Noodle
Syncing means that the source and destination are identical. When you remove files at the destination, that causes things to re-sync. Also, your rule conditions only catch stuff at the top level. If you look at the rule in the chapter on folder syncing, you can see that it's more involved than that.

If you only want changed files to be copied over (not synced), then that is a very different problem. Instead you should have something like two rules:

Rule 1: Copy files over if modified. Should not match folders. Copy action set to copy over folder structure.
Rule 2: Rule to go into subfolders (see manual on this).

You may need to tweak the above to match what you are looking for.

Re: Sync folder structure but only changed files not full fo

PostPosted: Tue Jan 24, 2023 6:38 pm
by logorrhoea
Ah, ok. Sorry, I misunderstood the sync feature.

Just tried the two rules suggested and it does exactly what I need.