3

I often use the integrated VSS feature on Windows files servers, to allow users to restore themselve some files. This also allow IT team to do the job fast when few files are involved, which is the most frequent problem.

For example I take one VSS per working hour (10 per day), and retain them during 4 weeks (5 working days per week) --> total = 200 VSS for 4 weeks

I'd like to use some "flexible" retention policy:
For example keeping each hourly VSS during 3 working days, then 4 VSS per day for the next 7 working days, then 2 VSS per day during the next 10 working days --> total = 78 VSS for 4 weeks

The space occupied by the VSS in both cases should be similar.
My point is not to save space. It is to extend the number of weeks during VSS are kept. But as NTFS can have a maximum of 512 VSS, then hourly VSS is not sustainable more than 10 weeks. And this is a huge number.

Question: do you think I should write a PowerShell script to manage the VSS retention policy? Or can I use something already done (script or software)?

Gregory MOUSSAT
  • 1,737
  • 2
  • 25
  • 48
  • [*"There is also an upper limit of 64 copies per volume that can be stored before the oldest copy is deleted."*](https://technet.microsoft.com/en-us/library/cc753975(v=ws.11).aspx) – jscott Nov 17 '16 at 03:24

2 Answers2

3

You can just adapt this simple script to your needs:

#This script deletes all shadow copies older than 30 days 
#By Wayne Johnson 

Get-WmiObject Win32_Shadowcopy | ForEach-Object { 

    $WmiSnapShotDate = $_.InstallDate 
    $strShadowID = $_.ID 
    $dtmSnapShotDate = [management.managementDateTimeConverter]::ToDateTime($WmiSnapShotDate)  
    $strClientAccessible = $_.ClientAccessible 
    $dtmCurDate = Get-Date 

    $dtmTimeSpan = New-TimeSpan $dtmSnapShotDate $dtmCurDate  
    $intNumberDays = $dtmTimeSpan.Days 

    If ($intNumberDays -ge 31 -and $strClientAccessible -eq "True") { 
        $_.Delete() 
    }

}
Bertrand SCHITS
  • 2,902
  • 1
  • 12
  • 15
1

You should have actual offline backups to other media for long-term data recovery needs. Shadow copies are fantastic for short-term, user-facing restores, but will not (and should not) be your entire data protection tool.

mfinni
  • 35,711
  • 3
  • 50
  • 86
  • 1
    Can you please show me where do you see anything stating "we don't have any serious backup"? – Gregory MOUSSAT Nov 17 '16 at 04:20
  • Nope, you didn't say that, in fact you didn't say anything about backups at all. You asked for opinions on managing something, and I gave you mine. I would not put my time into writing such a script. I might consider spending 20 minutes on Google to see if something had already been done and looked good. I would definitely put this into perspective of the organization's overall data protection stance. – mfinni Nov 17 '16 at 13:51