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
Sync Script with Background Processing?
Re: Sync Script with Background Processing?
There is no way apart from e.g. invoking a second instance of XY together with this script...
One of my scripts helped you out? Please donate via Paypal
Re: Sync Script with Background Processing?
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?
Em, your current working instance isn't blocked anymore... You won't get more "background processing" than that
One of my scripts helped you out? Please donate via Paypal
Re: Sync Script with Background Processing?
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.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. 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.
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;
Code: Select all
run "cmd /c <xy> /new /script=""C:\Zen\sync_test.xys""", , 2, 0;
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440
Re: Sync Script with Background Processing?
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!
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?
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.
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.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440
Re: Sync Script with Background Processing?
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
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