+ Post New Thread
Results 1 to 7 of 7
Windows Thread, System State in Technical; Here's what I do with my System State backups: I have two scripts that are task scheduled to run daily. ...
  1. #1

    Join Date
    Dec 2008
    Location
    Plymouth
    Posts
    63
    Thank Post
    6
    Thanked 10 Times in 7 Posts
    Rep Power
    14

    System State

    Here's what I do with my System State backups:
    I have two scripts that are task scheduled to run daily.

    The 1st script backs up the System State and stores it on another server (else what's the point - if the server failed and you cannot recover your system state backups!)
    To stop these backup files clogging up the destination server's drives, the second script deletes all such files older than a configurable number of days.

    If you'd like I can post the actual scripts here.

  2. #2
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,548
    Thank Post
    517
    Thanked 56 Times in 50 Posts
    Rep Power
    29
    I'm always up for reading someone else's scripts. Ta.

  3. #3

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,236
    Thank Post
    1,057
    Thanked 1,067 Times in 624 Posts
    Rep Power
    740
    Quote Originally Posted by reggiep View Post
    I'm always up for reading someone else's scripts. Ta.
    Here is a nice simple one for you then....

    Code:
    ntbackup backup systemstate /J "stjohns01_systemstate_friday" /F "z:\stjohns01\system state\friday\stjohns01_systemstate_friday.bkf"  /V:yes /L:f /M normal

  4. Thanks to mattx from:

    reggiep (4th February 2009)

  5. #4

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,272
    Thank Post
    614
    Thanked 1,567 Times in 1,407 Posts
    Rep Power
    412
    Don't forget that if you backup the systemstate you don't need a second job to backup the c: drive or systemdrive as that's done at the same time.

    Ben

  6. #5

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,236
    Thank Post
    1,057
    Thanked 1,067 Times in 624 Posts
    Rep Power
    740
    Quote Originally Posted by plexer View Post
    Don't forget that if you backup the systemstate you don't need a second job to backup the c: drive or systemdrive as that's done at the same time.

    Ben
    I have a belt and braces approach, the system state daily [ so I always have 7 copies ] to a NAS box, then a FULL back using Backup exec to tape......[ including the system state again....]

  7. #6

    Join Date
    Dec 2008
    Location
    Plymouth
    Posts
    63
    Thank Post
    6
    Thanked 10 Times in 7 Posts
    Rep Power
    14
    Quote Originally Posted by plexer View Post
    Don't forget that if you backup the systemstate you don't need a second job to backup the c: drive or systemdrive as that's done at the same time.

    Ben
    That's not correct. System State backs up AD (if run on a DC), the registry and some system files but in no way does it back up the entire system drive.

    Anyway, here are the scripts I use. I didn't write the 1st - the author's details are in it:
    Code:
    '===========================================================================
    ' Name: SystemStateBackup.vbs
    ' Version: 2.0
    ' Author: Jeremy Lawrence
    ' Bug Reports & Enhancement Req: jlawre23@csc.com
    '
    ' Main Function:	Performs a System State Backup on WinXP, Win2K, and Win2k3
    '===========================================================================
    DIM strDate
    DIM strComputerName
    DIM strBytes
    
    Set WshNetwork = WScript.CreateObject("WScript.Network")
    strComputerName = WshNetwork.ComputerName
    strDate = month(Now) & "-" & day(Now) & "-" & year(Now)
    Const HARD_DISK = 3
    
    
    strComputer = "."
    
    Set objWMIService = GetObject("winmgmts:" _
        & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colDisks = objWMIService.ExecQuery _
        ("SELECT * FROM Win32_LogicalDisk WHERE DriveType = " _
            & HARD_DISK & "")
    For Each objDisk in colDisks
        strBytes = FormatNumber((objDisk.FreeSpace / 1073741824),2)
        If strBytes <= 0.30 then
        Wscript.Echo "You do not have enough disk space to place the System State backup on this drive.  Please find another location."
     Else
    
       '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
       '@ Uncomment this line if you want an interactive process
       '@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        'Wscript.Echo objDisk.DeviceID & " has " & " " & strBytes & "GB of space available"
    End If
    
    Next
    
    Set oWshShell = CreateObject("WScript.Shell")
    
     
    '@@@@@@@@@@@@@@@@@@@@@@@@@
    '@ Comment one of the next two statements out, depending on your
    '@ preferences. Also, you must change the path if using the 1st statement
    '@@@@@@@@@@@@@@@@@@@@@@@@@
    strDest="Your path here" 
    'strDest= inputbox("Please enter the location you would like to save the system state.  The location must have a minimum 300MB of space." & vbCr & vbCr & "Example:  C:\Systemstate","CSC System State Backup","C:\systemstate")
    
     
    
    oWshShell.Run "ntbackup backup systemstate /f " & strDest & "\Systemstate" & "_" & strDate & "_" & strComputerName & ".bkf /m copy"
    As I've stated before, these backup files will rapidly clog drive space, so I use the 2nd script to delete any such files older than seven days. Here's the script to do that:
    '================================================= =======
    ' This script removes SystemState
    ' backups from a directory that are older than 7 days.
    '================================================= =======

    Set fso = CreateObject("Scripting.FileSystemObject")
    olddate = DateAdd("d", -7, date)

    '@@@@@@@@@@@@@@@@@@@@@@@@@@@
    '@ Change the path below to match your setup
    '@@@@@@@@@@@@@@@@@@@@@@@@@@@

    Set folder = fso.GetFolder("Your path here")
    Set fc = folder.Files
    For Each f1 In fc
    if f1.DateLastModified < olddate Then
    'wscript.stdout.write "Removing: " & f1.DateLastModified & vbtab & f1.name & VbCrLf
    fso.deletefile(f1)
    End if
    Next
    This can of course be used for all sorts of purposes, like a drop-box folder that acts as a tempory storage facility.

  8. #7

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,272
    Thank Post
    614
    Thanked 1,567 Times in 1,407 Posts
    Rep Power
    412
    Must just be what backupassist does when you pick system state then as it tells me I don't need to do c:

SHARE:
+ Post New Thread

Similar Threads

  1. Cannot Backup System State
    By robbied69 in forum Windows
    Replies: 6
    Last Post: 24th September 2008, 03:45 PM
  2. Replies: 5
    Last Post: 24th June 2008, 09:38 AM
  3. Novabackup / Orlogix System state ?
    By Grommit in forum Windows
    Replies: 1
    Last Post: 3rd April 2008, 09:38 PM
  4. System state and Files backup
    By trickstar in forum Windows
    Replies: 9
    Last Post: 13th March 2008, 11:26 AM
  5. Backing Up System State
    By mrforgetful in forum Windows
    Replies: 27
    Last Post: 11th January 2007, 02:04 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •