Find Sync example doesn't actually compare or sync

I was going through the detailed notes as to what changed in Directory Opus 13 and saw something I've wanted for a long time: automated syncing between folders! The very example given on the help page for the new feature for reference is:

Find SYNC FROM D:\Work TO D:\Backups COMPARE=newer HIDEUNAFFECTED
Copy SYNC
Set CLEARSYNC

I created a button using that script as a starting point, and when I click the button it does indeed load my two specified paths but shows no work to be done at all. I've been fiddling around with various options all morning and am fairly confident the following is what I want on that button, given the above example:

Find SYNC FROM \\Path1 TO \\Path2 COMPARE=newer,size HIDEUNAFFECTED DELETE FIRST
Copy SYNC
Set CLEARSYNC

But it just doesn't do anything. If I manually load those two folders into the left/right, invoke the sync tool, and hit the "Compare" button it shows me exactly the changes I expect to be made. But I can't get that button to do anything. The best I seem to be able to accomplish is to get it to configure the sync pane so I can hit the compare and then synchronize buttons myself.

What am I missing?

Are you passing just network server names, without any shares below them?

No, the actual pattern is of the following type:

Path1: \\NAS1\Share\Folder\Subfolder
Path2: \\NAS2\Share\Folder\Subfolder

The two servers are both Synology NAS units with an identical folder structure. NAS1 is my primary and NAS2 is my backup in case NAS1 fails. I keep the folders in sync as it is using tools other than Directory Opus, but I figure if I can reduce the sync to a single button-click I can use DO instead.

Thanks! That looks fine.

If you run the three commands separately (or just run the first one to start the comparison, then do the rest as you would without the commands), does that work?

[Edit: Crossed out below paragraphs, as I was wrong. Correction in my later reply, below.]

I'm not sure they're intended to all be run at once from a single button/hotkey. This is something I haven't used yet myself and didn't work on, but I suspect each step is meant to be run separately, after the previous step has completed. So it can automate setting up the Sync panel and starting the comparison, but you may then need to wait for that before starting the copy.

If I'm right, the 2nd and 3rd lines are only really useful for use with hotkeys to avoid using the mouse, not for fully automated syncing. (And we need to improve the documentation, but I need to confirm that first.)

(The Copy command can do other types of syncing/updating which can be fully automated, but won't delete files in the destination that aren't in the source.)

No. Maybe the very first line is the problem. I've whittled my script down to the following on my button:

Find SYNC FROM \Path1 TO \Path2 COMPARE=newer,size HIDEUNAFFECTED DELETE FIRST

This loads up both sides of the lister correctly, but the sync section down below isn't visible at all and both sides of the lister are empty. If I subsequently hit Ctrl + Y, then the sync section down below opens with the correct options, and I can then press the buttons one by one. But of course that's a lot less useful than being able to run a sync with a single button click.

Does it make any difference if you add RUNINPANEL?
Find SYNC FROM \Path1 TO \Path2 COMPARE=newer,size HIDEUNAFFECTED RUNINPANEL DELETE FIRST

Yes, adding the "RUNINPANEL" makes the actual sync panel appear and apparently run the compare. That's one step closer to the truly automated one-button-sync I'm after!

Good!
My guess is that the other commands are not waiting for the comparison to finish.
I remember I've done something similar but with Find Dupes (via scripting). Since Sync doesn't create a new tab for results, I'm not quite sure what to look in order to know that the comparson task has been completed.

Bummer. There isn't any kind of "Wait" or something? I guess I thought that line N+1 of the script wouldn't be executed until line N had completed.

This is on my list to look at as I believe it should be possible in 13.

That would be great! Thanks for letting me know!

So the example given in the manual does seem to work ok here in a quick test.

Perhaps there really is no work to be done given the criteria you are specifying?

If you show a screenshot of how you have the Sync panel configured and the exact function you're trying, we can try and see if something's different between the two.

Today I'm seeing different behavior, and I don't know why. I know I rebooted my computer after installing the Directory Opus 13 upgrade, but maybe something else subsequently updated in the reboot I did last night? I don't know. Let me now amend my support request a tiny bit.

What I now see is that it seems like the default script does indeed work with one odd unwelcome artifact. It does indeed open the correct paths in my lister, and it does in fact do the sync now. But it enables grouping by type in one or both listers in a seemingly non-deterministic fashion. Sometimes it's the left pane that's grouped by type, sometimes the right, sometimes both. That's weird as I haven't specified any kind of folder customization for the paths in question.

I can't offer any explanation for why it's working differently today, but perhaps there's a niggling little group-by bug in there somewhere?

I don't think there's any reason for sync to turn on grouping itself, but maybe it's a by-product of a folder format. Try hovering over the (i) icon in the status bar for the tab with grouping turned on and see what it says about where the format came from.

It says "Edited by user (auto-remembered)", but I am fairly confident I have never grouped that folder by type.

If you remove its entry from Preferences / Folders / Folder Formats / Automatic Formats it should stop happening.

I'm not even sure I realized automatic formats were a thing, but that fixed my issue. Now I'm going to have to go digging into that feature to figure out how to use it properly. Thanks!

Try adding RECURSE to the first line:

Find SYNC FROM "D:\Work" TO "D:\Backups" RECURSE COMPARE=newer HIDEUNAFFECTED
Copy SYNC
Set CLEARSYNC

That was missing from the example but would usually be wanted with sync, so I'll add that to the docs. It's probably why it wasn't seeming to do anything as well (depending on the folder structures being synced).

Testing with that added, it works how I expect now.

Aha! That did it! That's going in my notes. Thanks! I'm so happy to have an automated sync feature that works from a simple button press. Now it's time to start making it work from a command line... :slight_smile:

Working here also. If you get a cmdline sync going, please post details here. Thanks.