Solved

NT Backup Command

Posted on 2001-09-14
4
618 Views
Last Modified: 2013-12-28
"I schedule a NT Backup bat file for my Server as the following command, Anyone please check anything wrong with my command line?"

Ntbackup backup T:\ /d "Daily Backup" /hc:off /t incremental /l "DailyBackup" /e

if errorlevel 4 goto errorlevel4
if errorlevel 3 goto abortlevel3
if errorlevel 2 goto conflictlevel2
if errorlevel 1 goto no_fileslevel1
if errorlevel 0 goto successlevel0

:errorlevel4
echo Backup stopped the process due to an error
goto exit
:abortlevel3
echo You just pressed CTRL+C to stop the backup
goto exit
:conflictlevel2
echo One or more files were not backed up due to a sharing conflict
goto exit
:no_fileslevel1
echo Sorry, but there were no files to backup
goto exit
:successlevel0
echo The backup was successful
goto exit
:exit

"Note: Who know what wrong with the above command? when I run the bat file it worked, but it will auto close after few minute. For the Log file part, where the log file save to?"

"Thank you!"
0
Comment
Question by:geoffry
  • 2
4 Comments
 
LVL 4

Expert Comment

by:arminl
ID: 6482491
Hi,

I am not quite sure what you mean when you say "it will auto close after few minute", but I assume that the backup procedure may start, but the batch file probably will not wait for the end but terminate prematurely with an errorlevel of 0? Am I right? Or is there any thing else aou haven't mentioned, e.g. are you trying to run the batch through the at command or another time scheduling program?

If the first case applies, try to run ntbackup using the

start /wait

command (see start /?) for details. This schould make the batch file wait for ntbackup to end before going on. I haven't checked this though, I thought batches would wait for .exe files to terminate by default, but I can also be wrong ...

Armin Linder
0
 
LVL 23

Accepted Solution

by:
Tim Holman earned 100 total points
ID: 6482692
The logfile will end up whereever the user executed the batch file from.
eg - if you're at the C:\ prompt, log file will go there.
If backup is incremental, then it will backup only changed files.  If this is quick, then maybe there haven't been many file changes ?

0
 
LVL 2

Author Comment

by:geoffry
ID: 6482924
Hi! Armin Linder,
I agree what u have said. I tried to "rem" all the error coding as below it doesn't work as well, & also I am very sure there is no other schedule runing at that time;

Ntbackup backup T:\ /d "Daily Backup" /hc:off /t incremental /l "DailyBackup" /e

rem if errorlevel 4 goto errorlevel4
rem if errorlevel 3 goto abortlevel3
rem if errorlevel 2 goto conflictlevel2
rem if errorlevel 1 goto no_fileslevel1
rem if errorlevel 0 goto successlevel0

rem :errorlevel4
rem echo Backup stopped the process due to an error
rem goto exit
rem :abortlevel3
rem echo You just pressed CTRL+C to stop the backup
rem goto exit
rem :conflictlevel2
rem echo One or more files were not backed up due to a sharing conflict
rem goto exit
rem :no_fileslevel1
rem echo Sorry, but there were no files to backup
rem goto exit
rem :successlevel0
rem echo The backup was successful
rem goto exit
rem :exit

Hi! Tim Holman,
Thanks for your comment, I have tried to search for the log file which it my backup bat file saved in c:\bkp.bat, but it is not there, maybe my backup is not successful so it not create a lod file is it? shouldn't be right?
for the backup time shoudn't be so fast, because I am using blank tape with doing the 35GB database backup.

:::::::::::::::::::::::::::::::::::::::::::::::::::
Ntbackup backup T:\ /d "Daily Backup" /hc:off /t incremental /l "DailyBackup" /e

please anything wrong with the above command line.
0
 
LVL 23

Expert Comment

by:Tim Holman
ID: 6482959
The /e ensures only errors are logged to the log file.  If there aren't any errors, then you won't get any log file !

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

861 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