Server 2012 separate monthly backups to network share

Hi,

We have a NAS on our domain (network share) that we that we would like to do a backup to on the 1st of each month.  We do not want the previous months backup to be erased. So we end up with 12 backups(jan, feb, ....,dec). This backup will be taken off-site at the end of the year and replaced with another NAS.

Is there a script we can schedule can accomplish this? Any help will be greatly appreciated.

Thank you,

Eric

March 28th, 2015 7:05pm

To accomplish what exactly? Making the monthly backups? Copying it to another NAS at the end of the year? What tools are you using to make the backups?

You need to give a lot more information of what you would like to achieve.

Free Windows Admin Tool Kit Click here and download it now
March 28th, 2015 7:23pm

For custom solutions I recommend that you contact a consultant the can assist you with this.

This is a forum for technicians and administrators using scripting in their work.  It is not a free consulting forum.

March 28th, 2015 7:43pm

We currently have a 4 disk weekly rotation of daily backups.

We want the monthly backups are for a monthly offsite archive of the previous year.

Hoping to get assistance with wbadmin or a windows backup powershell script to make the backups

We would like to backup d:\data to a share(\\nas-2015\monthly). Is it possible to script backup to \\nas-2015\monthly\01 for jan, \\nas-2015\monthly\02 for feb, etc?

The reason for this is that from what I read, scheduling a monthly script of

"Wbadmin start backup -backupTarget:\\nas-2015\monthly -include:d:\data,p\admin -vssCopy"

will not do an incremental backup. So I'm wondering if I can get around this by creating a seperate folder for each backup


  • Edited by ebsea 58 minutes ago
Free Windows Admin Tool Kit Click here and download it now
March 28th, 2015 10:17pm

We currently have a 4 disk weekly rotation of daily backups.

We want the monthly backups are for a monthly offsite archive of the previous year.

Hoping to get assistance with wbadmin or a windows backup powershell script to make the backups

We would like to backup d:\data to a share(\\nas-2015\monthly). Is it possible to script backup to \\nas-2015\monthly\01 for jan, \\nas-2015\monthly\02 for feb, etc?

The reason for this is that from what I read, scheduling a monthly script of

"Wbadmin start backup -backupTarget:\\nas-2015\monthly -include:d:\data,p\admin -vssCopy"

will not do an incremental backup. So I'm wondering if I can get around this by creating a seperate folder for each backup


  • Edited by ebsea Sunday, March 29, 2015 6:08 AM
March 29th, 2015 2:09am

I am a consultant. Unfortunately I'm an old one. I'm from ntbackup and command line days.

I'm asking because there seems to be some controversy over whether this type of backup will work.

Free Windows Admin Tool Kit Click here and download it now
March 29th, 2015 2:17am

I am a consultant. Unfortunately I'm an old one. I'm from ntbackup and command line days.

I'm asking because there seems to be some controversy over whether this type of backup will work.


I recommend seeking a third party solution for traditional backups. In modern Widows we tend t separate dat from system n such awat rhat  we cab use DFSR and other replication methods to create redundancy.
March 29th, 2015 5:38am

ebsea, I understand where you're coming from, but I agree with jrv completely.

As you've presented the problem, it will be very hard for you to find help here, since you're asking for free help to do something that will probably require quite a bit of research and testing on our side for something that normally most of us here would charge for (as consultants).

Instead, may I suggest that you concentrate on small steps of what you're trying to achieve, do a lot of testing on your side and ask very concrete questions when you come across a problem?

I.e.,

Is it possible to script backup to \\nas-2015\monthly\01 for jan, \\nas-2015\monthly\02 for feb, etc?

That's a concrete question, the answer is yes.

If you want to programmatically modify the folder something goes to depending on the month of the year (or any other time variable), in PowerShell you can use the Get-Date CmdLet.

To look at all of the properties and methods that the object it returns has, just do:

Get-Date | Get-Member

This will show you that there is a Month property of type Integer (among other things), so doing:

(Get-Date).Month

Will return the number of the current month. So 1, 2, ... 12. However, this will not have a leading zero for months with a single digit, which is useless for what you're after.

While we could do silly things like string manipulation (append a zero to the left side of the string and then return only the two characters from the right, as was done in VBScript), this is PowerShell and there is no need for that nonsense anymore.

Instead, looking at the documentation (https://technet.microsoft.com/en-us/library/hh849887.aspx) shows us that Get-Date has a -Format parameter and delving a bit deeper onto how to use it (https://technet.microsoft.com/en-us/library/ee692801.aspx) tells us it can do exactly what we're after. In the case of returning the month with a leading 0 for single digit months we simply do:

Get-Date -Format MM

And that's it, job done.

Hope this helped. If you have any more concrete questions feel free to ask.

Fausto

Free Windows Admin Tool Kit Click here and download it now
March 29th, 2015 5:49am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics