Hi,
I have a text file with this content:
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001 Microsoft Corp.
Contents of shadow copy set ID: {bcfa443a-2977-4ca1-880b-2403044e9b84}
Contained 1 shadow copies at creation time: 8/2/2005 7:45:01 AM
Shadow Copy ID: {bd423380-bee9-40a4-a592-61cc9a3fa25e}
Original Volume: (E
\\?\Volume{a8375e45-0323-11d9-8bae-505054503030}\
Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy6
Provider: 'Microsoft Software Shadow Copy provider 1.0'
Type: ClientAccessible
Attributes: Persistent, Client-accessible, No auto release, No writers, Differential
Contents of shadow copy set ID: {6bfcbdf7-7d73-4b97-9119-1072ae5d8d40}
Contained 1 shadow copies at creation time: 8/2/2005 8:00:03 AM
Shadow Copy ID: {4ea692f9-5583-460b-97b4-df9b373950bb}
Original Volume: (E
\\?\Volume{a8375e45-0323-11d9-8bae-505054503030}\
Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy7
Provider: 'Microsoft Software Shadow Copy provider 1.0'
Type: ClientAccessible
Attributes: Persistent, Client-accessible, No auto release, No writers, Differential
Contents of shadow copy set ID: {01ebf7e2-414d-41c0-9d61-c9425b3814f0}
Contained 1 shadow copies at creation time: 8/2/2005 8:15:02 AM
Shadow Copy ID: {f1894607-d53d-4501-837a-e9060d4458c9}
Original Volume: (E
\\?\Volume{a8375e45-0323-11d9-8bae-505054503030}\
Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy8
Provider: 'Microsoft Software Shadow Copy provider 1.0'
Type: ClientAccessible
Attributes: Persistent, Client-accessible, No auto release, No writers, Differential
Contents of shadow copy set ID: {15154c47-84e4-4759-ad45-96779483152b}
Contained 1 shadow copies at creation time: 8/2/2005 8:30:01 AM
Shadow Copy ID: {e431ebc9-88f6-4e7b-a02f-4de67f6ecef2}
Original Volume: (E
\\?\Volume{a8375e45-0323-11d9-8bae-505054503030}\
Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy9
Provider: 'Microsoft Software Shadow Copy provider 1.0'
Type: ClientAccessible
Attributes: Persistent, Client-accessible, No auto release, No writers, Differential
And am looking for the Shadow Copy ID with time stamps of 8:15, 12:15 and 16:15.
My script stops after find the Shadow Copy ID for 8:15 and I can't figure out why....
Her is my code:
#!/usr/bin/perl
unless (open(FILE1, "files/shadow-list.txt")) {
if (-e "files/shadow-list.txt") {
die ("File files/shadow-list.txt exists, but cannot be opened.\n");
} else {
die ("File files/shadow-list.txt does not exist.\n");
}
}
$line = <FILE1>;
@words = ("8:15", "12:15", "16:15");
foreach $word (@words) {
while ($line ne "") {
if ($line =~ /$word/) {
$line = <FILE1>;
print ($line);
} else {
$line = <FILE1>;
}
}
}
My output is:
Shadow Copy ID: {f1894607-d53d-4501-837a-e9060d4458c9}
But all I reall need is:
{f1894607-d53d-4501-837a-e9060d4458c9}
But for all three times.
Thanks for the help!
-Joe
I have a text file with this content:
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool
(C) Copyright 2001 Microsoft Corp.
Contents of shadow copy set ID: {bcfa443a-2977-4ca1-880b-2403044e9b84}
Contained 1 shadow copies at creation time: 8/2/2005 7:45:01 AM
Shadow Copy ID: {bd423380-bee9-40a4-a592-61cc9a3fa25e}
Original Volume: (E
Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy6
Provider: 'Microsoft Software Shadow Copy provider 1.0'
Type: ClientAccessible
Attributes: Persistent, Client-accessible, No auto release, No writers, Differential
Contents of shadow copy set ID: {6bfcbdf7-7d73-4b97-9119-1072ae5d8d40}
Contained 1 shadow copies at creation time: 8/2/2005 8:00:03 AM
Shadow Copy ID: {4ea692f9-5583-460b-97b4-df9b373950bb}
Original Volume: (E
Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy7
Provider: 'Microsoft Software Shadow Copy provider 1.0'
Type: ClientAccessible
Attributes: Persistent, Client-accessible, No auto release, No writers, Differential
Contents of shadow copy set ID: {01ebf7e2-414d-41c0-9d61-c9425b3814f0}
Contained 1 shadow copies at creation time: 8/2/2005 8:15:02 AM
Shadow Copy ID: {f1894607-d53d-4501-837a-e9060d4458c9}
Original Volume: (E
Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy8
Provider: 'Microsoft Software Shadow Copy provider 1.0'
Type: ClientAccessible
Attributes: Persistent, Client-accessible, No auto release, No writers, Differential
Contents of shadow copy set ID: {15154c47-84e4-4759-ad45-96779483152b}
Contained 1 shadow copies at creation time: 8/2/2005 8:30:01 AM
Shadow Copy ID: {e431ebc9-88f6-4e7b-a02f-4de67f6ecef2}
Original Volume: (E
Shadow Copy Volume: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy9
Provider: 'Microsoft Software Shadow Copy provider 1.0'
Type: ClientAccessible
Attributes: Persistent, Client-accessible, No auto release, No writers, Differential
And am looking for the Shadow Copy ID with time stamps of 8:15, 12:15 and 16:15.
My script stops after find the Shadow Copy ID for 8:15 and I can't figure out why....
Her is my code:
#!/usr/bin/perl
unless (open(FILE1, "files/shadow-list.txt")) {
if (-e "files/shadow-list.txt") {
die ("File files/shadow-list.txt exists, but cannot be opened.\n");
} else {
die ("File files/shadow-list.txt does not exist.\n");
}
}
$line = <FILE1>;
@words = ("8:15", "12:15", "16:15");
foreach $word (@words) {
while ($line ne "") {
if ($line =~ /$word/) {
$line = <FILE1>;
print ($line);
} else {
$line = <FILE1>;
}
}
}
My output is:
Shadow Copy ID: {f1894607-d53d-4501-837a-e9060d4458c9}
But all I reall need is:
{f1894607-d53d-4501-837a-e9060d4458c9}
But for all three times.
Thanks for the help!
-Joe