Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am pretty unfamiliar with doing NTbackup via command line but I have a user who had someone setup his computer to backup to a 1TB external drive.

The backup command looks like this:

C:\WINDOWS\system32\ntbackup.exe backup "@C:\Documents and Settings\username\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data\User Backup.bks" ^
  /a /d "Set created 1/7/2011 at 12:12 PM" /v:no /r:no /rs:no /hc:off /m normal ^
  /j "User Backup" /l:s /f "I:\UserComputerBackup\UserBackup.bkf"

This user has used all the space on his 1TB Drive. My question is - is there a way to specify NTBackup to to only keep the last 3 or 4 backups and overwrite anything older?

I know this is available in some software backup solutions - but this was done using ntbackup originally and I'd like to continue to do that.

Any ideas?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

My question is - is there a way to specify NTBackup to to only keep the last 3 or 4 backups and overwrite anything older?

No sorry, ntbackup is a very light weight backup. It doesn't have keep track of versions or anything, so there is nothing in NTbackup that allows this. If you want to continue using NTBackup you will have to address its limitations using external scripts/tools.

I wrote a little python script which I used until we upgraded to Windows 2008 to schedule/manage ntbackup. You define your backup details in an xml file and the python tool will run the ntbackup with the correct option. You set the number of versions you want to keep and so on.

share|improve this answer
    
How about deleting old sets? Ultimately if I could just delete old sets I would be content as I could delete all the out-dated backups and he would be set going forward. –  Hanny Mar 26 '12 at 18:35
    
Oh, wow. Sorry didn't look closely at your ntbackup command line. As far as I know there is no way to remove a set from a bkf file. You should be creating a different bkf file each backup period. –  Zoredache Mar 26 '12 at 18:39
    
alright, that's originally what I thought also. Kind of got thrown into this mess. Is the /a tag what is causing it to all get appended to 1 giant file? –  Hanny Mar 26 '12 at 18:43
    
Correct /a puts it in append mode. Here is a list of the command line options. support.microsoft.com/kb/814583 –  Zoredache Mar 26 '12 at 18:55
    
Thanks Zoredache. Thanks for the script as well. I will look into using that in the future I think - looks really helpful. This pretty much covers everything I thought was going on. I have this one large backup file that contains a number of different sets... a mess. I'm thinking a software solution may be in order in the future for this person. –  Hanny Mar 26 '12 at 19:04

I had to write a script to accomplish what you are asking to do. Basically mine is set to backup the system images of some VMs. These backup to a folder using the current date. SO they end up in say x:\backup\2012-03-26. Since the X: is on our NAS, I check the drive once a day to see if there is at least 1TB of storage and simply delete the oldest day one at a time until there is 1TB of storage left (our nightly is about 900GB). I used VBS to accomplish this. basically the VBS is running from in the task scheduler on each VM. The script runs on each machine indepedantly. But since they all use the date as the common folder name, the files all end up in their own respective folders:

x:\backup\2012-03-26\VSRV06 x:\backup\2012-03-26\VADS01 x:\backup\2012-03-26\VSQL01 ....etc.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.