Task Scheduler – .bat running but won’t run

The migration of my Oracle DB server to another one was successful except one thing, and its important one. It’s the backup running from task scheduler !

 

 

Since my backups where script based, in past I did not have problems with it.

After migration, server was up, db was working, clients were happy, the backup script when run manually was successfully creating backups.DBBackup.JPG

I was about to add the .bat script to task scheduler, but that part was struggling me for half a day.

I tried all the suggested methods that included, running script as system,  changing location of script, running through powershell, or running script as admin etc…

I always had same behavior, and that is : task was in running state, but script wasn’t started and the backup file was not generated.

Solution for me was that the Program/Script path had to be under quotes marks.

“C:\backup\script.bat”

Even though I didn’t have any “spaces” in filenames of path, the script won’t run.

After adding quotes marks to file path, the task scheduler was able to run the script and create backup.

DB taskScheduler

Note.

Running scripts that includes network mapped drives will require that task is configured to run only when user is logged on. This is because you cant have mapped drive without user logged on system.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.