Re: Real-time sync of large files.
Posted: Tue May 24, 2011 1:59 pm
Re i) If you use the command line with /nosvc option, even a task in the normal project file will run once, but please do not run the real-time task, it will never end.
Re ii) If you start the task by command line, and the task is already running, the task will be started twice. It will find the changed files and sync them. If the two same tasks run simultaneously, one file may be copied twice, or fail with access denied error.
If the task is not set as a real-time sync task, BestSyncSvc.exe will end after the task finishs. You can us the following script to detect whether BestSyncSvc.exe is running, if it is running, just wait for it ends.
------------------------------------------------------------------------------
set svc=getobject("winmgmts:root\cimv2")
sQuery="select * from win32_process where name='BestSyncSvc.exe'"
set cproc=svc.execquery(sQuery)
iniproc=cproc.count 'it can be more than 1
Do While iniproc = 1
wscript.sleep 2000
set svc=getobject("winmgmts:root\cimv2")
sQuery="select * from win32_process where name='BestSyncSvc.exe'"
set cproc=svc.execquery(sQuery)
iniproc=cproc.count
Loop
------------------------------------------------------------------------------
Re ii) If you start the task by command line, and the task is already running, the task will be started twice. It will find the changed files and sync them. If the two same tasks run simultaneously, one file may be copied twice, or fail with access denied error.
If the task is not set as a real-time sync task, BestSyncSvc.exe will end after the task finishs. You can us the following script to detect whether BestSyncSvc.exe is running, if it is running, just wait for it ends.
------------------------------------------------------------------------------
set svc=getobject("winmgmts:root\cimv2")
sQuery="select * from win32_process where name='BestSyncSvc.exe'"
set cproc=svc.execquery(sQuery)
iniproc=cproc.count 'it can be more than 1
Do While iniproc = 1
wscript.sleep 2000
set svc=getobject("winmgmts:root\cimv2")
sQuery="select * from win32_process where name='BestSyncSvc.exe'"
set cproc=svc.execquery(sQuery)
iniproc=cproc.count
Loop
------------------------------------------------------------------------------