dexterhome
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
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
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
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.
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
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.
ASKER
I am not using the /N switch as i am appending data.
ASKER
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
ASKER
"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.