Closed

Small vb.net script

This project received 20 bids from talented freelancers with an average bid price of $187 USD.

Get free quotes for a project like this
Employer working
Skills Required
Project Budget
$30 - $250 USD
Total Bids
20
Project Description

I need a small deamon that would trigger every 24 hours (adjustable if possible via gui or config) that will do the following:

REMOVE the oldest backups from a Windows Server Backup Set.

I need to remove anything over 60 days, so you get current time/date and figure when is our trigger date.. [url removed, login to view] of may if we are on the 23rd of july..

then anything older then that we delete the shadow copies... it's a simple parse procedure. here are the windows commands i use manually...

1) running this gets me a list of all shadow copies.

Vssadmin list shadows > Desktop\[url removed, login to view]


IF YOU LOOK AT [url removed, login to view] youll find hundreds of:

Contents of shadow copy set ID: {d4676c38-0929-4e14-9aee-037c896b0825}
Contained 1 shadow copies at creation time: 6/3/2013 3:30:16 AM
Shadow Copy ID: {d6bff3b7-72f3-4df6-9abf-d12d27fd7c1e}
Original Volume: (\?\Volume{34af372d-733c-11e2-b714-000acd190390}\)\?\Volume{34af372d-733c-11e2-b714-000acd190390}\
Shadow Copy Volume: \?\GLOBALROOT\Device\HarddiskVolumeShadowCopy95
Originating Machine: [url removed, login to view]
Service Machine: [url removed, login to view]
Provider: 'Microsoft Software Shadow Copy provider 1.0'
Type: DataVolumeRollback
Attributes: Persistent, No auto release, No writers, Differential

Contents of shadow copy set ID: {f2148be7-52cf-4359-8a60-d34a7c915572}
Contained 1 shadow copies at creation time: 6/4/2013 6:56:41 AM
Shadow Copy ID: {896eeafd-3598-417c-88e8-bf2e6aeaa88f}
Original Volume: (\?\Volume{34af372d-733c-11e2-b714-000acd190390}\)\?\Volume{34af372d-733c-11e2-b714-000acd190390}\
Shadow Copy Volume: \?\GLOBALROOT\Device\HarddiskVolumeShadowCopy96
Originating Machine: [url removed, login to view]
Service Machine: [url removed, login to view]
Provider: 'Microsoft Software Shadow Copy provider 1.0'
Type: DataVolumeRollback
Attributes: Persistent, No auto release, No writers, Differential

Contents of shadow copy set ID: {c9cde92e-5662-4255-a38c-2883f68b502c}
Contained 1 shadow copies at creation time: 6/5/2013 3:30:39 AM
Shadow Copy ID: {ee818ada-3b44-431b-8e01-8aa6c84eeebb}
Original Volume: (\?\Volume{34af372d-733c-11e2-b714-000acd190390}\)\?\Volume{34af372d-733c-11e2-b714-000acd190390}\
Shadow Copy Volume: \?\GLOBALROOT\Device\HarddiskVolumeShadowCopy97
Originating Machine: [url removed, login to view]
Service Machine: [url removed, login to view]
Provider: 'Microsoft Software Shadow Copy provider 1.0'
Type: DataVolumeRollback
Attributes: Persistent, No auto release, No writers, Differential


you simply identify sets that start with :

Contents of shadow copy set ID:
until the Attributes line..

then you find line with date... if valid date to delete ( over the trigger date as in before 34rd of may in our example) then you write the Shadow Copy ID line to a buffer/txtbox anything to use later....
as in " Shadow Copy ID: {ee818ada-3b44-431b-8e01-8aa6c84eeebb}" but you str_replace the Shadow Copy ID: wording for Delete shadows ID

giving you something like


Delete shadows ID {d6bff3b7-72f3-4df6-9abf-d12d27fd7c1e}

Delete shadows ID {896eeafd-3598-417c-88e8-bf2e6aeaa88f}

Delete shadows ID {ee818ada-3b44-431b-8e01-8aa6c84eeebb}




once you looped em all , you save that list to a file in our example [url removed, login to view] on desktop. and run as elevated prompt or any other means

diskshadow /s c:\users\Administrator\Desktop\[url removed, login to view]

which runs the list commands to delete all shadows in the list...


this is an example , there might be some windows api in .net to do this easier.

i'd like a GUI for start/stop service and change the numbers of days to keep and time it runs ( every 24 hours at midnight etc etc)

simple project, i'd prefer it's all encapsulated in the .net and no cmd prompts but anything goes..

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online