||In a batch file like this:
1 C:\PVSW\PBA\bin\pvbackup.exe -on
2 xcopy f:\stuff\*.dat g:\backup\stuff\ /E /V /Y /R
3 C:\PVSW\PBA\bin\pvbackup.exe -off
4 xcopy f:\stuff\*.* g:\backup\stuff\ /E /V /Y /R
sometimes the xcopy in line 4 still finds *.^^^ files.
It looks like the command "pvbackup.exe -off" returns too early.
The Backup Agent is simply using the "Continuous Operations Mode" of the database. When the ENDBU is received by the engine, the engine confirms that all files will start the roll-in process (wherein all
changes are rolled out of the delta files into the live files again).
The problem is that this process is also running in tandem with a live system. While the changes are being rolled back to the live files, new changes may be recorded at the Delta file -- making the process take
longer. In fact, this roll-in process can easily take in excess of minutes, hours in some very busy systems, and possibly even never.
Because of this, the PVBACKUP -OFF cannot be tied to the completion of the roll-in process, and the only way to ensure that the roll-in is complete is to wait until all deltas disappear.
There are two solutions:
1) Exclude the Delta files from your last XCOPY. This is MUCH easier.
2) Add code in the batch file to loop on the delta files. Something
IF EXIST *.^^^^^^ GOTO Loop
Use XXCOPY or ROBOCOPY, two XCOPY replacements that are much more powerful, and that only copy files that have been changed. onsole, not from a remote session.