[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Batch file for ntbackup won't run from the task scheduler but will run from the command line

Posted on 2006-06-07
9
Medium Priority
?
436 Views
Last Modified: 2012-06-27
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-Daily-Backup.bks" /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-systemstate.bkf"
************

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....
0
Comment
Question by:DavidWiggins1970
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 16850140
Hi DavidWiggins1970,

when you run the scheduled task manually...does it work?
0
 

Author Comment

by:DavidWiggins1970
ID: 16850820
Hi Jay_Jay70

I have tried to run it manually from scheduled tasks but it still won't run.  
0
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 16851229
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
0
Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

 
LVL 88

Expert Comment

by:rindi
ID: 16851381
Make sure the task is run as a system account and not as a user account in the taskmanager.
0
 
LVL 48

Expert Comment

by:Jay_Jay70
ID: 16851439
0
 
LVL 32

Accepted Solution

by:
r-k earned 1000 total points
ID: 16852780
I think rindi has the right suggestion. Instead of using the Control Panel to schedule your job, use the AT command instead. For example, to schedule a batch file named daily.bat to run every morning at 5 AM:

 c:\> AT 05:00 /every:M,T,W,Th,F,S,Su c:\backup\daily.bat

The AT command automatically uses the System user to schedule the job.

Once you have scheduled it, make changes to it only with the AT command, not with the Task Scheduler.

Here are some details on the command in case needed:

 http://support.microsoft.com/default.aspx?scid=kb;en-us;313565&sd=tech
0
 

Author Comment

by:DavidWiggins1970
ID: 16860152
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.

0
 

Author Comment

by:DavidWiggins1970
ID: 16891234
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.



0
 
LVL 32

Expert Comment

by:r-k
ID: 16891452
Thanks and good luck.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month18 days, 11 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question