View Single Post
  #6 (permalink)  
Old 07-04-2008, 02:40 PM
darius
Newsgroup Contributor
 
Posts: n/a
Re: Windows backup: append day of week to filename?

"Pegasus \(MVP\)" <I.can@fly.com.oz> wrote in
news:OfWdABS3IHA.784@TK2MSFTNGP04.phx.gbl...

>
> If you get the GUI to schedule the backup run for the various
> days of the week then you need to modify the backup task
> in the Control Panel / Task Scheduler. A good starting point
> would be to post the command line you see under the properties
> of that task.
>


Thanks. I think I figured it out. For those interested:

1) setup your backup job and schedule it using the GUI per usual.

2) go to control panel / scheduled tasks and double click on the backup
task you created.

3) Copy the Run field. It should be something like
c:\windows\system32\ntbackup.exe followed by long command line arguments.

4) create a file using notepad and save it somewhere as "backup job.cmd"
Substitute 'backup job' with whatever name you like.

5) add this as first line

set dotw=%date:~0,3%

What this does is set dotw to the first 3 letters of the date variable.
This assumes your date format starts with the day of the week. If not,
you need to play with this. Run cmd and type

echo %date%

and

echo %date:~0,3%

to see what you get

6) paste the line you copied in step 3) on next line

7) edit the line you just pasted so that the part that says

/f "something.bkf"

become

/f "something-%dotw%.bkf"

8) Change the Run field in Step 3) so it points to the .cmd file you just
created. (use the browse button.)

Voila
Reply With Quote

 
Old 07-04-2008, 02:40 PM