Link to home
Start Free TrialLog in
Avatar of andyoww
andyoww

asked on

Windows backup date for the tape

We set up a scheduled task to back up our servers every week night.  When the back up runs, every tape gets the same date.  This date is the date the job was created.  Can I take the string in the run line ("Media created 3/2/2005 at 1:45 PM" /d "Set created 3/2/2005 at 1:47 PM") and change the dates to %date%?

Will this work or is there another way?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Kevin Hays
Kevin Hays
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of andyoww
andyoww

ASKER

I found this:

http://support.microsoft.com/default.aspx?scid=kb;en-us;239892&sd=tech

Which says:

This is a more complex example, however, it is a real-life example that performs the following procedures completely unattended: • Refreshes RSM database.
• Sleeps for 30 seconds to ensure that RSM is refreshed.
• Sets environment variables used to create unique tape names.
• Starts Ntbackup, which Mounts any existing tape in the tape drive by using the /um switch.
• Performs the backup and changes the tape name to the following format:
Machine_Name-date-time
• Ejects the tape from the tape drive.
echo off
  rsm.exe refresh /LF"HP C1537A SCSI Sequential Device"
  sleep 30
  for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%i-%%j-%%k-%%l
  for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
  set tm=%tm::=-%
  set dtt=%dt%%tm%
  c:\winnt\system32\ntbackup.exe backup "@C:\Documents and Settings\Administrator\Local Settings
\Application Data\Microsoft\Windows NT\NTBackup\data\Daily.bks"
  /n "%computername%-%dtt%" /d "daily %dtt%" /v:yes /r:no /rs:no /hc:on
  /m normal /j "daily %dtt%" /l:f /p "4mm DDS" /UM
  rsm.exe eject /PF"%computername%-%dtt% - 1" /astart
  exit
            
Do you have your batch file run as a scheduled task then?
Are you using e:\Backups\ as you backup directory instead of sending to tape?
Avatar of andyoww

ASKER

I got it to work using the batch file I found.

I'll give you the points because you pointed me in the right direction.

Thanks!
No problems, glad you got something that fits your needs, what it's all about :)

Kevin