
December 7th, 2011, 02:16 AM
|
|
Registered User
|
|
Join Date: Dec 2011
Posts: 1
Time spent in forums: 35 m 54 sec
Reputation Power: 0
|
|
|
Problems with batch file running in parallel
this problem is associated with my server (Windows Server 2003 R2 Enterprise x64 edition)
I have two scheduled tasks which runs two batch files respectively (let's called them A.bat and B.bat) on 2am and 7am everyday. The things they do are quite similar, exporting dump files in database for different schema (around 10 schema for A.bat and around 6 for B.bat) and zipping them accordingly.
Dump files for different schema are exported successfully but some of them couldn't be zipped. Usually those dump files which could not be zipped are created after 7am. I managed to do the zipping (7-zip) in parallel in cmd so parallel zipping should not be causing the problem. One strange thing that I observed is that the batch file continues to run, exporting dump file for next schema, even though it didn't zip the dump file for current schema. And usually A.bat doesn't execute the "goto endloop"
There is no sign of error in the log that I have kept.
Below is part of the batch file,
:loop
if %curr_schema%==END goto endloop
if %count% GEQ 1000 goto endloop
exp parfile=%backup_root_dir%\%curr_schema%.par
"C:\program files\7-zip\7z" a -t7z %dest%\%curr_schema%_%curdate%.7z %dest%\%curr_schema%_%curdate%.dmp >> %logfile%
goto loop
:endloop
echo done!
|