Solved

NT Backup Command

Posted on 2001-09-14
4
601 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

Want to promote your upcoming event?

Attending an event? Speaking at a conference? Or exhibiting at a trade show? Easily inform your contacts by using a promotional banner in your email signature. This will ensure your organization’s most important contacts are in the know.

Question has a verified solution.

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

Update 11/3/2014 - Although the below article will get you to relocate the WINSXS folder, Microsoft has finally released a utility to reduce the size of the WINSXS folder. For some reason, it's not that straightforward. It only works on Windows 2008…
Several part series to implement Internet Explorer 11 Enterprise Mode
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

867 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now