Link to home
Create AccountLog in
Avatar of dexterhome
dexterhomeFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Add date and time stamp to backups

Hi All.
I am using windows server 2000 and ntbackup.
I wish to write a script to automate the backup process.

I have searched on the internet and found some answers, but not all.

I understand that i must create the file using the gui and then open the schedule task and copy the data to the file to become my script.
The issue i am having is making any sense of adding the date and time stamp to it.

Please can someone advise me of the what a time/date stamp should look like in my script and where it should go.

thanks in advance
ASKER CERTIFIED SOLUTION
Avatar of slam69
slam69
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of dexterhome

ASKER

So what does the following mean:
"tokens=1-3 delims=/ "
%%d in ("%date%")
%%d%%e%%f.xls

Looking at the excel file I presume that this will rename something with todays date.
what do the other do?

I will be backing up to tape drive.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
I have just playing around on a file based on the advise you gave.
It appears that this just writes a simple batch based command to rename the file after it has been created by the backup.

How do i integrate this into my backup.

I will be backing up to tape, so can not rename file afterwards.
apologies I was answeering teh question as asked and that didnt include backing up directly to tape

paste your script that you currently have and ill take a look at it however i may not be able to do this as i dont use taoes, but teh script shoudl be comparable and be easy to manipulate
Take your existing NTBACKUP command and remove the /N switch.  It should then name the backup with the date and time.
I am not using the /N switch as i am appending data.
The solution helped me with the date stamping. However i found the main body of scripting to tape on the internet and justed added the date stamp to it. It help me understand better