Page 1 of 1

Sync Script with Background Processing?

Posted: 30 Aug 2018 18:47
by Jim-W
A simple script to sync two folders but I can't find how or if it's even possible to run a sync script in the background.

sync "D:\Test", "D:\_Test", 1, 0, 1, "cp";

Is there a switch or something? I have Background Processing enabled in Configuration > File Operations.

Any help would be appreciated.

Thanks

J

Re: Sync Script with Background Processing?

Posted: 30 Aug 2018 18:51
by highend
There is no way apart from e.g. invoking a second instance of XY together with this script...

Re: Sync Script with Background Processing?

Posted: 30 Aug 2018 19:14
by Jim-W
I try this, and still not in the background.

Code: Select all

"C:\Program Files (x86)\XYplorer\XYplorer.exe" /script=SyncTest

Re: Sync Script with Background Processing?

Posted: 30 Aug 2018 19:17
by highend
Em, your current working instance isn't blocked anymore... You won't get more "background processing" than that

Re: Sync Script with Background Processing?

Posted: 30 Aug 2018 21:49
by klownboy
To run in a second instance of XYplorer, you'd have to run a command like the following. It depends on whether you are running a script file or running script commands.

Code: Select all

run "cmd /c <xy> /new /win=tray /script=""::sync 'D:\Test', 'D:\_Test', 1, 0, 1, 'cp';if(get('instance')=='2') {exit 'n';}""", , 2, 0;
You may have to get rid of the "c" and "p" switches since it's running in the background. You could also get rid of the "/win=tray" parameter. Take a look at the help file under Configuration | Command Line Switches. If you have the sync command in a script file you can call the script file as shown in Help.

Code: Select all

 run "cmd /c <xy> /new /script=""C:\Zen\sync_test.xys""", , 2, 0;
You don't have to use the "cmd /c" shown there, but I've had better script experiences going that route especially if you don't care to see the second instance.

Re: Sync Script with Background Processing?

Posted: 03 Sep 2018 19:18
by Jim-W
I guess I just don't get why you can run a manual sync in XY and while sync is running you can close XY and the sync/XYCopy keeps running.

When I use /win=tray, the buttons on the sync dialog don't work (Pause, Cancel, X).

I'll find another solution.

Thanks for your help!

Re: Sync Script with Background Processing?

Posted: 03 Sep 2018 20:08
by klownboy
Because of the dialogs involved with sync, I didn't think you'd be able to use /win=tray that why I mentioned getting rid of that command line switch.

By the way, in Configuration | File Operations | Background Processing, do you have that checked (along with Queue file operations), and under the Apply to... have Sync operations also checked? I don't use background operations myself in this case, but you may want to try enabling it and see if, with syncing files in progress, you can continue do normal XY operations...that's the whole idea.

Re: Sync Script with Background Processing?

Posted: 12 Oct 2018 16:32
by Jim-W
Background Processing and Queue file operations are checked.

I have found that "Backup" works as expected from a script but Sync does not.

This looks like a bug or XY Sync just won't work for me.

Thanks