#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    1
    Rep 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!
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2012
    Posts
    17
    Rep Power
    0
    Hi,

    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

IMN logo majestic logo threadwatch logo seochat tools logo