DavidWiggins1970
asked on
Batch file for ntbackup won't run from the task scheduler but will run from the command line
I am having a problem getting a batch file to run from within the task scheduler. The batch file consists of the following which is a copy and paste of all the text in the file:
************
C:\WINNT\system32\NTBACKUP .EXE backup "@C:\scripts\Exchange-Dail y-Backup.b ks" /n "Exchange-Daily-Backup" /d "Daily-Exchange-Backup" /v:yes /r:no /rs:no /hc:off /m normal /j "Exchange-Daily-Backup" /l:s /f "C:\Server Backup\Backup-exchange-sys temstate.b kf"
************
The config file is called Exchange-Daily-Backup.bks and has the following in it:
************
JET MAINFRAME\Microsoft Information Store\First Storage Group\
SystemState
************
I can run the batch file from the command line and it works fine. I then go into the task scheduler and schedule a task and it won't run - not exactly sure why. I have checked that the task is set to run as administrator, and i set up a simpler batch file to test that ran OK. I was wondering if there is something in the commands above that is needed so it can be run by the task scheduler, or something I am missing. The test batch file that I tried only move a file.
I am running W2K SP4 and any ideas would be appreciated.
Thanks....
************
C:\WINNT\system32\NTBACKUP
************
The config file is called Exchange-Daily-Backup.bks and has the following in it:
************
JET MAINFRAME\Microsoft Information Store\First Storage Group\
SystemState
************
I can run the batch file from the command line and it works fine. I then go into the task scheduler and schedule a task and it won't run - not exactly sure why. I have checked that the task is set to run as administrator, and i set up a simpler batch file to test that ran OK. I was wondering if there is something in the commands above that is needed so it can be run by the task scheduler, or something I am missing. The test batch file that I tried only move a file.
I am running W2K SP4 and any ideas would be appreciated.
Thanks....
ASKER
Hi Jay_Jay70
I have tried to run it manually from scheduled tasks but it still won't run.
I have tried to run it manually from scheduled tasks but it still won't run.
there is a link for this but wouldnt you beleive it i cant find it. ill get a hold of it tomorrow and post for you
Make sure the task is run as a system account and not as a user account in the taskmanager.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks to all for the fast flow of suggestions ... Greatly appreciated.
Just to clarrifiy there is also another batch file that is run 15 minutes before the scheduled backup batch file is supposed to run. The first job simply moves the previous days backup file to an archive folder, and deletes the file from two days before. I call it the cleanup batch file below.
I scheduled the cleanup batch file and the backup back file using the AT command. The cleanup batch file ran and did all it was supposed to do, but the backup one still didn't run. I then went and executed the backup batch file manually and it ran backing up what it was supposed to.
I checked out the http://support.microsoft.com/?kbid=821730 and I am assuming that because the batch file runs the backup fine that the command line parameters are OK? Please let me know if I have assumed incorrectly. I am also using w2k sp4, and the KB only mentions 2003. The version of ntbackup I have on the w2k server is 5.00.2195.6713. not sure if the version mentioned in the 2003 hotfix would work or cause any problems.
Hope that all makes sense.
Just to clarrifiy there is also another batch file that is run 15 minutes before the scheduled backup batch file is supposed to run. The first job simply moves the previous days backup file to an archive folder, and deletes the file from two days before. I call it the cleanup batch file below.
I scheduled the cleanup batch file and the backup back file using the AT command. The cleanup batch file ran and did all it was supposed to do, but the backup one still didn't run. I then went and executed the backup batch file manually and it ran backing up what it was supposed to.
I checked out the http://support.microsoft.com/?kbid=821730 and I am assuming that because the batch file runs the backup fine that the command line parameters are OK? Please let me know if I have assumed incorrectly. I am also using w2k sp4, and the KB only mentions 2003. The version of ntbackup I have on the w2k server is 5.00.2195.6713. not sure if the version mentioned in the 2003 hotfix would work or cause any problems.
Hope that all makes sense.
ASKER
For some reason after adding the jobs using the AT command they didn't run the first time. The jobs have run every day since then though, so thanks for the advice and the command reference link.
Thanks and good luck.
when you run the scheduled task manually...does it work?