tabs ↹ over ␣ ␣ ␣ spaces

by Jiří {x2} Činčura

PAUSE command moral

14 Dec 2010 1 mins Batch files, Windows

Few days ago I created batch file to backup Firebird databases, Subversion repositories and some other data on a new server. During the testing of the script I put PAUSE command at the end, to see the result (or better to say errors). After I was done with polishing it up I created record in Task Scheduler and started test run. Everything finished in a couple of minutes nicely. I left it there, expecting it to do the backup during the night, as scheduled.

Next day I checked the result and the task failed with 0x8004131F aka SCHED_E_ALREADY_RUNNING. I checked CPU and disk utilization and it was clear the backup is not running. Kind of confused I ran backup manually and waited another day. And guess what, same error. As you probably now see, the problem was the PAUSE command at the end of the script. So the task was actually running, and waiting for the input. Clearly visible in Process Explorer.

I removed it and now everything works fine. Such a stupid mistake caused such a confusion. 😃

Profile Picture Jiří Činčura is .NET, C# and Firebird expert. He focuses on data and business layers, language constructs, parallelism, databases and performance. For almost two decades he contributes to open-source, i.e. FirebirdClient. He works as a senior software engineer for Microsoft. Frequent speaker and blogger at www.tabsoverspaces.com.