+ Post New Thread
Results 1 to 9 of 9
Windows Server 2000/2003 Thread, NtBackup Nightmare! in Technical; Now then fellow techies, I have a new problem, Thanks for everyone's help on the last one. Ok I am ...
  1. #1
    jpenn's Avatar
    Join Date
    Mar 2009
    Location
    Hull
    Posts
    43
    Thank Post
    7
    Thanked 3 Times in 3 Posts
    Rep Power
    11

    NtBackup Nightmare!

    Now then fellow techies, I have a new problem, Thanks for everyone's help on the last one. Ok I am looking for a script which will delete Incremental backup's of a certain age i have found a few online while searching but nothing that seems to be quite right. Basically i do one full backup per week and then incrementals each day i would like to delete any backups older than say 4 weeks old. Any advice would be most appreciated as my scripting skills add up to zero.

    Cheers People

    Jon

  2. #2
    IrritableTech's Avatar
    Join Date
    Nov 2007
    Location
    West Yorkshire
    Posts
    793
    Thank Post
    83
    Thanked 171 Times in 140 Posts
    Rep Power
    64
    I dont remember where I found this... but found it useful.

    Code:
    Dim i, fso, f, f1, sf, BasePath, CalcResult, fNameArray()
    BasePath = "T:\Backup Directory\"
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set f = fso.GetFolder(BasePath)
    Set sf = f.SubFolders
    For Each f1 in sf
         CalcResult = DateDiff("d",f1.DateCreated,Now)
              if CalcResult > 30 then
                    ReDim preserve fNameArray(i)
                    fNameArray(i) = f1.Name
                    i = i + 1
            end if
    Next
    
    For Each fName in fNameArray
        FSO.DeleteFolder(BasePath & "\" & fName)
    Next
    You should just need to change the BasePath, and the number of days old (CalcResult > 30).

  3. Thanks to IrritableTech from:

    jpenn (19th August 2009)

  4. #3
    jpenn's Avatar
    Join Date
    Mar 2009
    Location
    Hull
    Posts
    43
    Thank Post
    7
    Thanked 3 Times in 3 Posts
    Rep Power
    11
    Very nice! and a very quick reply thank you. Now i find myself with another problem. We need to have some backup data going back 3 to 4 weeks but i am running incremental backups set to append not replace, unfortunatly the append option is just making one big backup with no way that i can see to delete anything. Am i missing something, am i just being completley stupid. Think i've spent to much time googling this. please help!!!!

  5. #4
    IrritableTech's Avatar
    Join Date
    Nov 2007
    Location
    West Yorkshire
    Posts
    793
    Thank Post
    83
    Thanked 171 Times in 140 Posts
    Rep Power
    64
    To be honest (although I'm not a big fan of NTBackup) I would probably set jobs up something like this...

    Week 1

    Saturday - Full Backup - Replace - Run every 28 days - First Run 22nd August - Called Week 1 Full
    Monday Night - Incremental - Replace - Run every 28 days - First Run 24th August - Called Week 1 Monday Inc
    Tuesday Night - Incremental - Replace - Run every 28 days - First Run 25th August - Called Week 1 Tuesday Inc
    Wednesday Night - Incremental - Replace - Run every 28 days - First Run 26th August - Called Week 1 Wednesday Inc
    Thursday Night - Incremental - Replace - Run every 28 days - First Run 27th August - Called Week 1 Thursday Inc

    Week 2

    Saturday - Full backup - Replace - Run every 28 days - First Run 29th August - Called Week 2 Full
    Monday Night - Incremental - Replace - Run every 28 days - First Run 31st August - Called Week 2 Monday Inc
    Tuesday etc etc.

    Week 3

    Saturday - Full backup - Replace - Run every 28 days - First Run 5th September - Called Week 3 Full
    etc etc.

    Week 4
    etc etc.

    It does mean setting up 20 jobs in the calendar, but the time you put in now saves time later. I hope it makes sense.

  6. Thanks to IrritableTech from:

    jpenn (19th August 2009)

  7. #5
    jpenn's Avatar
    Join Date
    Mar 2009
    Location
    Hull
    Posts
    43
    Thank Post
    7
    Thanked 3 Times in 3 Posts
    Rep Power
    11
    Yeah i understand it nice i will put it to the boss and see what he has to say!!

  8. #6
    jpenn's Avatar
    Join Date
    Mar 2009
    Location
    Hull
    Posts
    43
    Thank Post
    7
    Thanked 3 Times in 3 Posts
    Rep Power
    11
    I seem to have got myself in a pickle yet again. Following your instructions was going great but as i could not find an option to repeat every 28 days i was telling to do it on every last monday, last tuesday etc. But my plan fell apart when because of the differences of days in a month the weeks became inter-mingled with each other. Oh for a really world class Head doctor right now. my brain is fried help!

  9. #7
    leco's Avatar
    Join Date
    Nov 2006
    Location
    West Yorkshire
    Posts
    2,026
    Thank Post
    595
    Thanked 125 Times in 119 Posts
    Rep Power
    41
    Quote Originally Posted by jpenn View Post
    I seem to have got myself in a pickle yet again. Following your instructions was going great but as i could not find an option to repeat every 28 days i was telling to do it on every last monday, last tuesday etc. But my plan fell apart when because of the differences of days in a month the weeks became inter-mingled with each other. Oh for a really world class Head doctor right now. my brain is fried help!
    In the settings dialogue check Weekly, then just beneath that set Every 4 weeks (i.e. 28 days). Incidentally the Advanced button next to the date leads to a dialogue where the start date can be set.
    Hope that helps.

  10. Thanks to leco from:

    jpenn (20th August 2009)

  11. #8
    IrritableTech's Avatar
    Join Date
    Nov 2007
    Location
    West Yorkshire
    Posts
    793
    Thank Post
    83
    Thanked 171 Times in 140 Posts
    Rep Power
    64
    Quote Originally Posted by leco View Post
    In the settings dialogue check Weekly, then just beneath that set Every 4 weeks (i.e. 28 days). Incidentally the Advanced button next to the date leads to a dialogue where the start date can be set.
    Hope that helps.
    Or you can choose 'Daily' and select every 28 days. Sorry if I was unclear.

  12. Thanks to IrritableTech from:

    jpenn (20th August 2009)

  13. #9
    jpenn's Avatar
    Join Date
    Mar 2009
    Location
    Hull
    Posts
    43
    Thank Post
    7
    Thanked 3 Times in 3 Posts
    Rep Power
    11
    Right thats all set up. Thanks for the help again guys and gals where would i be without you lot. Only one more issue !!!!!!!! Just hope i've got enough space for all these backups.

SHARE:
+ Post New Thread

Similar Threads

  1. Ntbackup problem
    By WithoutMotive in forum Windows
    Replies: 6
    Last Post: 1st November 2007, 08:34 AM
  2. AOL nightmare
    By suesmate in forum How do you do....it?
    Replies: 3
    Last Post: 10th July 2007, 10:44 AM
  3. ntbackup help please :S
    By techyphil in forum Windows
    Replies: 16
    Last Post: 18th June 2007, 02:19 PM
  4. NTBackup
    By Gatt in forum Windows
    Replies: 3
    Last Post: 4th January 2007, 11:16 AM
  5. Nightmare
    By mrforgetful in forum ICT KS3 SATS Tests
    Replies: 6
    Last Post: 16th May 2006, 02:27 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
  •