Jump to content

Windows backup: append day of week to filename?


Recommended Posts

Guest Terry R.
Posted

The date and time was 7/2/2008 9:48 PM, and on a whim, darius pounded

out on the keyboard:

> I want to make a backup with multiple schedules, for each weekday. Is

> there a way to make it automatically append the day of week to the backup

> filename, like backup-MON, backup-TUE, backup-WED, etc. (The backup

> files are overwritten each week, but at any time, I have the backups of

> the last 5 weekdays.)

>

> I guess I could make 5 different backup jobs and give the filename I

> want, but it's a pain. Plus if I need to make changes (add or remove

> folders to the job), I have to go through all 5 jobs.

 

Hi Darius,

 

I would think using the /f command line parameter and using some DATE

variables you could accomplish it. Pegasus will probably have what you

need.

 

--

Terry R.

 

***Reply Note***

Anti-spam measures are included in my email address.

Delete NOSPAM from the email address after clicking Reply.

  • Replies 6
  • Created
  • Last Reply

Popular Days

Guest darius
Posted

Windows backup: append day of week to filename?

 

I want to make a backup with multiple schedules, for each weekday. Is

there a way to make it automatically append the day of week to the backup

filename, like backup-MON, backup-TUE, backup-WED, etc. (The backup

files are overwritten each week, but at any time, I have the backups of

the last 5 weekdays.)

 

I guess I could make 5 different backup jobs and give the filename I

want, but it's a pain. Plus if I need to make changes (add or remove

folders to the job), I have to go through all 5 jobs.

Guest Pegasus \(MVP\)
Posted

Re: Windows backup: append day of week to filename?

 

 

"Terry R." <F1Com@NOSPAMpobox.com> wrote in message

news:u86eEMM3IHA.1420@TK2MSFTNGP06.phx.gbl...

> The date and time was 7/2/2008 9:48 PM, and on a whim, darius pounded out

> on the keyboard:

>

>> I want to make a backup with multiple schedules, for each weekday. Is

>> there a way to make it automatically append the day of week to the backup

>> filename, like backup-MON, backup-TUE, backup-WED, etc. (The backup

>> files are overwritten each week, but at any time, I have the backups of

>> the last 5 weekdays.)

>>

>> I guess I could make 5 different backup jobs and give the filename I

>> want, but it's a pain. Plus if I need to make changes (add or remove

>> folders to the job), I have to go through all 5 jobs.

>

> Hi Darius,

>

> I would think using the /f command line parameter and using some DATE

> variables you could accomplish it. Pegasus will probably have what you

> need.

>

> --

> Terry R.

 

Since I hear my name mentioned, I suppose I have to reply!

 

To the OP: What is your current backup command?

Guest darius
Posted

Re: Windows backup: append day of week to filename?

 

"Pegasus \(MVP\)" <I.can@fly.com.oz> wrote in

news:eGPIC#M3IHA.4284@TK2MSFTNGP04.phx.gbl...

>

> Since I hear my name mentioned, I suppose I have to reply!

>

> To the OP: What is your current backup command?

>

 

Hi

 

I'm just using the GUI. (system tools / backup)

Guest Pegasus \(MVP\)
Posted

Re: Windows backup: append day of week to filename?

 

 

"darius" <noone@here.invalid> wrote in message

news:28984326860.8554256396.39632@msnews.microsoft.com...

> "Pegasus \(MVP\)" <I.can@fly.com.oz> wrote in

> news:eGPIC#M3IHA.4284@TK2MSFTNGP04.phx.gbl...

>

>>

>> Since I hear my name mentioned, I suppose I have to reply!

>>

>> To the OP: What is your current backup command?

>>

>

> Hi

>

> I'm just using the GUI. (system tools / backup)

 

If you create a new backup run with the GUI then you have to

type the day of the week when prompted for a destination file

name.

 

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.

Guest darius
Posted

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

Guest Pegasus \(MVP\)
Posted

Re: Windows backup: append day of week to filename?

 

 

"darius" <noone@here.invalid> wrote in message

news:58687825102.8554256396.39633@msnews.microsoft.com...

> "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

 

Well done! (This is actually a bit of an FAQ)


×
×
  • Create New...