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'm using NTBackup on a server 2003 R2 system, to backup to a file over the network, using a batch script.

What I'm trying to do is to change the name of the backup set as displayed in NTBackup's 'Restore and Manage Media' tab (highlighted below), as the list will become unmanageable when it gets larger. I want to use the format YYYY-MM-DD <name> to sort the list in a usable manner. Is this possible?

NTBackup

I've already tried /D, /J and /N. The only ones I haven't tried that might be relevant are /T and /P, neither of which are appropriate as I'm using /F to backup to file.

The command line I'm using is as follows:

ntbackup.exe backup "@%BKS%\%FILE%" /D "%NOW% %FILE%" /M normal /J "%NOW% %FILE%" /L:s /F %DEST%\%FILE%.bkf /N "%NOW% %FILE%"

All the above environment variables are set correctly.

%NOW% is the date in the format YYYY-MM-DD, %FILE% is the name of the BKS file, %DEST% is the network location that the backup is saved to, and %BKS% is the directory where I keep the .bks files. (Note the script uses a for loop to process all .bks files within the directory).

The backup itself works perfectly, it's just the Backup Identification Label in NTBackup that I want to change.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I think you need to change the backup filename to one that contains the date.

Try:

ntbackup.exe backup "@%BKS%\%FILE%" /D "%NOW% %FILE%" /M normal /J "%NOW% %FILE%" /L:s /F %DEST%\%NOW%-%FILE%.bkf /N "%NOW% %FILE%"
share|improve this answer
    
That parameter you've modified above isn't actually the filename used for the output of the backup process itself, it is actually the name of the selection file (i.e. the .bks file), in the above examples, it would be one of Accounts.bks, AdminFinance.bks etc. I could emulate what I want to do by renaming the bks files each day before the backup starts, but that's becoming very messy. –  Bryan Mar 14 '12 at 12:01
    
+1, as by modifying the filename of the backup (actually specified by the /F parameter) this will have the side effect of doing what I want. The destination file of the backup data itself isn't important to me. –  Bryan Mar 14 '12 at 12:15
    
I've edited your answer to change the /F parameter, rather than the bks filename. –  Bryan Mar 14 '12 at 12:17
add comment

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.