December 7th, 2011, 03:16 AM
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,
if %curr_schema%==END goto endloop
if %count% GEQ 1000 goto endloop
"C:\program files\7-zip\7z" a -t7z %dest%\%curr_schema%_%curdate%.7z %dest%\%curr_schema%_%curdate%.dmp >> %logfile%
January 29th, 2012, 10:54 AM
It will not show you when task was executed in scheduled task hence I would suggest you to open command prompt, navigate to the .bat file and execute here manually, it will show you exactly where its getting stuck