I am trying to use the NT command line backup system temporarily. I just wanted to know if there was any way of omitting files and or directories from the backup thrpugh the command line? Thanks for any answers.
I am trying to use the NT command line backup system temporarily. I just wanted to know if there was any way of omitting files and or directories from the backup thrpugh the command line? Thanks for any answers.
Can you tell me why running NTBACKUP from the run line and going into the Advance mode section and selecting what you do and dont want backed up work?
If that is a SBS server then the backup wizard works very well, by the way you can custom select folders? If it is failing, then are you backing up to a Mapped drive that is not there, or using \\server\path? The backup wizard running NTBACKUP from the run line must be doing this. So, if you post the backup log, then we can see why its not doing it.
You wont be able to put the exclusons on the command line, you have to use a created .bks file that you can create using the gui. There is an example that I used, much of it taken from the MS KB article about how to use ntbackup. This is backing up to an external USB connected drive G, rather than tape, the ntbackup line would be somewhat different with switches for tape, I can dig up the tape version if you would find it userful, I have got it from the previous Windows 2000 Server:
---
@echo off
for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%i-%%j-%%k-%%l
for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
set tm=%tm::=-%
set dtt=%dt%%tm%
c:\windows\system32\ntbackup.exe backup systemstate "@C:\Documents and
Settings\Administrator.journal\Local Settings\Application
Data\Microsoft\Windows NT\NTBackup\data\daily.bks" /F
"G:\%computername%-%dtt%.bkf" /D "daily %dtt%" /V:yes /M normal /J "daily
%dtt%" /L:s /FU
call c:\tools\copylog.cmd
exit
---
The copylog copies the log file to a folder on the desktop, and also uses BLAT to mail it to a couple of folks:
---
del c:\tools\*.log
xcopy "c:\documents and settings\administrator.journal\local
settings\application data\microsoft\windows nt\ntbackup\data\*.log" c:\tools
dir c:\tools\*.log /b /od >c:\tools\ordered.txt
echo %date% >c:\tools\copylogx.txt
echo %time% >>c:\tools\copylogx.txt
type c:\tools\copylog.txt >>c:\tools\copylogx.txt
rem c:\tools\uptime /s /a >>c:\tools\copylogx.txt
for /F "skip=9" %%1 IN (ordered.txt) do rename %%1 current.log
rem current.log is Unicode, so won't go in a text message.
type c:\tools\current.log >c:\tools\%dtt%.log
rem above converts current.log from unicode to ascii.
xcopy %dtt%.log "c:\documents and
settings\administrator.journal\desktop\backup logs\" <f.txt
c:\tools\blat.exe c:\tools\copylogx.txt -t [email addresses go here] -s
"%dtt% backup output" -attacht c:\tools\%dtt%.log
del ordered.txt
del copylogx.txt
---
This is an old post but I am interested in the copylog.cmd and the code for backup to tape please!
Bookmarks