Re: Scheduler and Batch Files
- From: Ernest <Ernest@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 25 May 2006 06:24:01 -0700
"Pegasus (MVP)" wrote:
"Ernest" <Ernest@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:980BE0DF-14E5-4F22-A534-765ED808A77A@xxxxxxxxxxxxxxxx
accomplish.
"Pegasus (MVP)" wrote:
"Ernest" <Ernest@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:99844F9F-40AB-4481-A819-BA908D35FE69@xxxxxxxxxxxxxxxx
"Pegasus (MVP)" wrote:
"Ernest" <Ernest@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DA48C18E-1152-4D94-9044-8163A1D11C75@xxxxxxxxxxxxxxxx
Let me preface the question by saying what I am trying to
0x1I
backuphave
12 servers that are all running ntbackup at night and storing the
schedulerfiles on the local c:\ drive (the .bkf file). I then have the
drive torunning a very simple batch file to move the files from the local
domaina
mapped share.
Now, 3 of the 12 servers are doing everything as planned (my two
controllers and another server), and the rest show an exit code of
andfor
executing the batch file. The actual ntbackups are running fine
thesuccessfully completing. About 30 minutes to an hour later, when
thanstaggeredbatch
files are running, only 3 complete successfully. I have all 12
at
different times to prevent a network bottleneck.
When I check the scheduler log, there isn't much more information
application,I
have posted above, and there are no erros in the system,
withor
security logs. I get the feeling that I have made a stupid error
runlocally,permissions or mapping, but I am not sure. I mapped the drives
so
they are user-agnostic, and I am using a generic admin account to
ofthe
backups and batch files. I have triple checked to make sure all
runsthe
file.mapping is correct and that the admin has rights to run teh batch
In
addition, if I run the batch file manually by clicking on it, it
Ifine
every time. I'm sure someone has run across the problem before.
notHere it is.....appreciate any help.
Let's have a look at your batch file!
Q:\ is the mapped drive
@echo off
copy C:\dailybackup\*.bkf Q:\ /Y /V
exit
As I had mentioned earlier, it works on 3 of the 12 machines with the
scheduler, and on the rest, it will work when activated manually, just
workswith the scheduler.
Fine. Now modify your batchfile like so:
@echo off
echo %date% %time:~0,5% %UserName% Start of task > c:\test.log
copy C:\dailybackup\*.bkf Q:\ /Y /V 1>>c:\test.log 2>>&1
echo ErrorLevel=%ErrorLevel% >> c:\test.log
echo %date% %time:~0,5% End of task >> c:\test.log
Schedule this batch file on a problem machine, then
have a look at c:\test.log. It is likely that you find the
answer to your problem there.
Ok, went ahead and changed the batch file and had the scheduler run it as
planned.
The output is (without the time/user stamps):
The system cannot find the drive specified.
ErrorLevel=1
I have checked the mapping of the drive several times, and everything
fine. It is present, I can save to and from it. I'm not sure what else
could be causing this.
There should be far more text in the log file. I suspect that
you retyped it rather than using copy & paste, and omitted
some redirection charachters in the process. Use the
version below, then post the WHOLE output:
@echo off
echo %date% %time:~0,5% %UserName% Start of task > c:\test.log
net use >> c:\test.log
copy C:\dailybackup\*.bkf Q:\ /Y /V 1>>c:\test.log 2>>&1
echo ErrorLevel=%ErrorLevel% >> c:\test.log
echo %date% %time:~0,5% End of task >> c:\test.log
You will probably find that drive Q: is NOT available,
for the simple reason that your batch file does not map
it. The batch file does not back up anything!
In general it is a bad idea to use mapped drives for scheduled
tasks. The drive letter might not be available, or if it is then it
might not be released for the next scheduled job and thus become
unavailable. Much better to use UNC coding.
You're probably right about the UNC, so what I will do is copy and paste
your code and let it run on one of the problem servers, then just change the
batch file on another problem server to UNC. Let's see what happens.
Thanks for all of the help. I appreciate it.
.
- References:
- Re: Scheduler and Batch Files
- From: Pegasus \(MVP\)
- Re: Scheduler and Batch Files
- From: Pegasus \(MVP\)
- Re: Scheduler and Batch Files
- From: Ernest
- Re: Scheduler and Batch Files
- From: Pegasus \(MVP\)
- Re: Scheduler and Batch Files
- Prev by Date: Re: is it safe to remove C:\WINDOWS\ServicePackFiles\i386?
- Next by Date: Licensing
- Previous by thread: Re: Scheduler and Batch Files
- Next by thread: Process affinity for services
- Index(es):
Relevant Pages
|