drotkopf
asked on
NTBACKUP in Command Line to backup only Exchange
Hi,
I have SBS 2003 and I want to write an NTBACKUP command line so I can schedule to backup Exchange's Microsoft Information Store daily.
I don't mind overwritting the exising .bkf file everytime since it will be backed up daily online.
Please, don't direct me to how to articles, just give me the command.
Thanks!
Dan
I have SBS 2003 and I want to write an NTBACKUP command line so I can schedule to backup Exchange's Microsoft Information Store daily.
I don't mind overwritting the exising .bkf file everytime since it will be backed up daily online.
Please, don't direct me to how to articles, just give me the command.
Thanks!
Dan
To where will you be backing it up? Tape or fixed disk?
ASKER
Fixed Disk. Let's say the folder is C:\Backups\Exchange
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
oh sorry, that script maps a network drive X: to share \\fileserver\exchangebacku p. You can remove that part if fixed disk.
-tom
-tom
ASKER
rindi:
I couldn't find what I was looking for in http://www.lwcomputing.com/tips/static/backup.asp
tmeunier:
I don't need to rotate. I want to overwrite yesterday's file with today''s backup. That's because yesterday's file was copied to a remote location already. I'm looking for as much simplicity as possible as this place is not run by techs.
Thanks.
I couldn't find what I was looking for in http://www.lwcomputing.com/tips/static/backup.asp
tmeunier:
I don't need to rotate. I want to overwrite yesterday's file with today''s backup. That's because yesterday's file was copied to a remote location already. I'm looking for as much simplicity as possible as this place is not run by techs.
Thanks.
Did you check the 2nd link I posted? You can also find it within the first Link under "Scripts". It'll direct you to download the script which leew made.
-------------------------- ---------- ---------- ---------- ----
C:\backups\ExchangeBackup. cmd
-------------------------- ---------- ---------- ---------- ----
@Echo off
:: Delete existing Exchange Full backup
ECHO Y| DEL "C:\BACKUPS\EXCHANGE\Excha nge full.bkf"
:: Backup command line
ntbackup.exe backup "@C:\BACKUPS\EXCHANGEFULL. bks" /d "Daily full Exchange backup" /v:no /r:no /rs:no /hc:off /m normal /j "Daily Exchange Full" /l:f /f "C:\BACKUPS\EXCHANGE\Excha nge Full.bkf"
:: Move job logs to C:\backups\ & name "Exchange backup date-time.log"
move "C:\Documents and Settings\username\local settings\application data\microsoft\windows nt\NTBackup\data\*.log" "c:\backups\LOGS\Exchange Backup.log"
exit
::::: NOTE that the \username\ portion of the move-job-logs line will be the user that you're using to run the script.
-------------------------- ---------- ---------- ---------- ----
C:\backups\exchangefull.bk s
-------------------------- ---------- ---------- ---------- ----
JET YOUR_SERVER_NAME\Microsoft Information Store\First Storage Group\
C:\backups\ExchangeBackup.
--------------------------
@Echo off
:: Delete existing Exchange Full backup
ECHO Y| DEL "C:\BACKUPS\EXCHANGE\Excha
:: Backup command line
ntbackup.exe backup "@C:\BACKUPS\EXCHANGEFULL.
:: Move job logs to C:\backups\ & name "Exchange backup date-time.log"
move "C:\Documents and Settings\username\local settings\application data\microsoft\windows nt\NTBackup\data\*.log" "c:\backups\LOGS\Exchange Backup.log"
exit
::::: NOTE that the \username\ portion of the move-job-logs line will be the user that you're using to run the script.
--------------------------
C:\backups\exchangefull.bk
--------------------------
JET YOUR_SERVER_NAME\Microsoft
By the way, Lee Wilbur's script is most awesome. And pay no attention to the comments lines in the little batch script I posted; I didn't clean them up for your purposes.
-tom
-tom
ASKER
Thanks guys. I'll try this one later tonight.
ASKER
Hi,
I'm running the script below, and it seems to start ok, but after 20-30 seconds it aborts and says it can't find the path.
@Echo off
:: Delete existing Exchange Full backup
:: ECHO Y| DEL "C:\BACKUP\EXCHANGE\Exchan geFull.bkf "
:: Backup command line
ntbackup.exe backup "C:\BACKUP\EXCHANGEFULL.bk s" /d "Daily full Exchange backup" /v:no /r:no /rs:no /hc:off /m normal /j "Daily Exchange Full" /l:f /f "C:\BACKUP\EXCHANGE\Exchan geFull.bkf "
:: Move job logs to C:\backups\ & name "Exchange backup date-time.log"
move "C:\Documents and Settings\administrator\loc al settings\application data\microsoft\windows nt\NTBackup\data\*.log" "c:\backup\LOGS\Exchange Backup.log"
::exit
Also, it seems to be backing up something in C: and not the Info Store:
untitled.JPG
I'm running the script below, and it seems to start ok, but after 20-30 seconds it aborts and says it can't find the path.
@Echo off
:: Delete existing Exchange Full backup
:: ECHO Y| DEL "C:\BACKUP\EXCHANGE\Exchan
:: Backup command line
ntbackup.exe backup "C:\BACKUP\EXCHANGEFULL.bk
:: Move job logs to C:\backups\ & name "Exchange backup date-time.log"
move "C:\Documents and Settings\administrator\loc
::exit
Also, it seems to be backing up something in C: and not the Info Store:
untitled.JPG
1. Create C:\BACKUP. WInthin that create C:\BACKUP\EXCHANGE and C:\BACKUP\LOGS
2. That script should be saved as C:\BACKUP\ExchangeBackup.c md
3. You should also create the file C:\BACKUP\ExchangeFull.BKF which includes the single line:
JET YOUR_SERVER_NAME\Microsoft Information Store\First Storage Group\
This is the configuration file that is referenced in the script, which tells NTBackup which file selections to run. The fact that it is selecting C: rather than YourServername | Info Store | First Storage Group is indicative that this file doesn't exist, or is mis-named, or something like that.
-tom
2. That script should be saved as C:\BACKUP\ExchangeBackup.c
3. You should also create the file C:\BACKUP\ExchangeFull.BKF
JET YOUR_SERVER_NAME\Microsoft
This is the configuration file that is referenced in the script, which tells NTBackup which file selections to run. The fact that it is selecting C: rather than YourServername | Info Store | First Storage Group is indicative that this file doesn't exist, or is mis-named, or something like that.
-tom
ASKER
I was missing the logs directory!
When you say "3. You should also create the file C:\BACKUP\ExchangeFull.BKF which includes ..."
you mean .bks, right?
When you say "3. You should also create the file C:\BACKUP\ExchangeFull.BKF
you mean .bks, right?
I do mean .bks, yes.
ASKER
Hi,
This is how the file looks after a couple of other fixes:
@Echo off
:: Delete existing Exchange Full backup
:: ECHO Y| DEL "C:\BACKUP\EXCHANGE\Exchan geFull.bkf "
:: Backup command line
ntbackup.exe backup "C:\BACKUP\EXCHANGEFULL.bk s" /d "Daily full Exchange backup" /v:no /r:no /rs:no /hc:off /m normal /j "Daily Exchange Full" /l:f /f "C:\BACKUP\EXCHANGE\Exchan geFull.bkf "
:: Move job logs to C:\backups\ & name "Exchange backup date-time.log"
move "C:\Documents and Settings\administrator.TEC HINT\local settings\application data\microsoft\windows nt\NTBackup\data\*.log" "c:\backup\ExchangeLogs"
::exit
Now, the backup file is a mere 10K big. I think it's what I mentioned before. Look at my screenshot. It's not backing up the inf store but something (really, nothing) in C:
This is a log file:
Backup Status
Operation: Backup
Active backup destination: File
Media name: "ExchangeFull.bkf created 8/9/2009 at 9:38 PM"
Volume shadow copy creation: Attempt 1.
Backup (via shadow copy) of "C: "
Backup set #1 on media #1
Backup description: "Daily full Exchange backup"
Media name: "ExchangeFull.bkf created 8/9/2009 at 9:38 PM"
Backup Type: Normal
Backup started on 8/9/2009 at 9:39 PM.
Backup completed on 8/9/2009 at 9:39 PM.
Directories: 0
Files: 0
Bytes: 0
Time: 1 second
----------------------
Thanks,
Dan
This is how the file looks after a couple of other fixes:
@Echo off
:: Delete existing Exchange Full backup
:: ECHO Y| DEL "C:\BACKUP\EXCHANGE\Exchan
:: Backup command line
ntbackup.exe backup "C:\BACKUP\EXCHANGEFULL.bk
:: Move job logs to C:\backups\ & name "Exchange backup date-time.log"
move "C:\Documents and Settings\administrator.TEC
::exit
Now, the backup file is a mere 10K big. I think it's what I mentioned before. Look at my screenshot. It's not backing up the inf store but something (really, nothing) in C:
This is a log file:
Backup Status
Operation: Backup
Active backup destination: File
Media name: "ExchangeFull.bkf created 8/9/2009 at 9:38 PM"
Volume shadow copy creation: Attempt 1.
Backup (via shadow copy) of "C: "
Backup set #1 on media #1
Backup description: "Daily full Exchange backup"
Media name: "ExchangeFull.bkf created 8/9/2009 at 9:38 PM"
Backup Type: Normal
Backup started on 8/9/2009 at 9:39 PM.
Backup completed on 8/9/2009 at 9:39 PM.
Directories: 0
Files: 0
Bytes: 0
Time: 1 second
----------------------
Thanks,
Dan
This is sort of bizarre. I'm getting the same behavior. Here's how I fixed it, and I have to admit I'm not going to screw with it because I'm lazy, but:
My ExchangeFull.bks file does this, when created in Notepad. But when I create the same thing in NTBackup, by making the selections in the GUI - selecting the information store - and then say file > Save as and I save it as C:\Backup\ExchangeFull.bks , THAT one works. The other strange thing is that when I type it in notepad, it's 59 bytes, but when I create it in NTBackup and save it, it's 122 bytes. To look at them in notepad, they're identical.
So, I have to throw up my hands and say, try running the GUI once, selecting your Info Store, and select Job > Save Selections As > c:\backups\exchangefull.bk s. Then try again. For me, it worked.
My ExchangeFull.bks file does this, when created in Notepad. But when I create the same thing in NTBackup, by making the selections in the GUI - selecting the information store - and then say file > Save as and I save it as C:\Backup\ExchangeFull.bks
So, I have to throw up my hands and say, try running the GUI once, selecting your Info Store, and select Job > Save Selections As > c:\backups\exchangefull.bk
ASKER
Will try that. Thanks.
ASKER
It didn't help.
ASKER
Hi,
I just scheduled it using NTBACKUP's gui and it's working fine.
Thanks!
I just scheduled it using NTBACKUP's gui and it's working fine.
Thanks!