// Discover excluded components that have file groups outside the shadow set. void GoogleVssClient::DiscoverNonShadowedExcludedComponents( const vector<wstring>& volume_names) { // Discover components that should be excluded from the shadow set having // at least one File Descriptor requiring volumes not in the shadow set. LogDebugMessage( L"Discover components that reside outside the shadow set ..."); for (unsigned idx = 0; idx < writers_.size(); idx++) { VssWriter* writer = &writers_[idx]; if (writer->isExcluded) { continue; } for (unsigned icx = 0; icx < writer->components.size(); icx++) { VssComponent* component = &(writer->components[icx]); if (component->isExcluded) { continue; } for (unsigned vol = 0; vol < component->affected_volumes.size(); vol++) { if (!FindStringInList(component->affected_volumes[vol], volume_names)) { wstring volume_path; GetDisplayNameForVolume(component->affected_volumes[vol], &volume_path); LogDebugMessage( L"- Component '%s' from writer '%s' is excluded from backup " L"(it requires volume %s [%s] in the shadow set)", component->fullPath.c_str(), writer->name.c_str(), component->affected_volumes[vol].c_str(), volume_path.c_str()); component->isExcluded = true; break; } } } } }
// Print summary/detalied information about this component void VssComponent::Print(bool bListDetailedInfo) { FunctionTracer ft(DBG_INFO); // Print writer identity information ft.WriteLine(L" - Component \"%s\"\n" L" - Name: '%s'\n" L" - Logical Path: '%s'\n" L" - Full Path: '%s'\n" L" - Caption: '%s'\n" L" - Type: %s [%d]\n" L" - Is Selectable: '%s'\n" L" - Is top level: '%s'\n" L" - Notify on backup complete: '%s'", (writerName + L":" + fullPath).c_str(), name.c_str(), logicalPath.c_str(), fullPath.c_str(), caption.c_str(), GetStringFromComponentType(type).c_str(), type, BOOL2TXT(isSelectable), BOOL2TXT(isTopLevel), BOOL2TXT(notifyOnBackupComplete) ); // Compute the affected paths and volumes if (bListDetailedInfo) { ft.WriteLine(L" - Components:"); for(unsigned i = 0; i < descriptors.size(); i++) descriptors[i].Print(); } // Print the affected paths and volumes ft.WriteLine(L" - Affected paths by this component:"); for(unsigned i = 0; i < affectedPaths.size(); i++) ft.WriteLine(L" - %s", affectedPaths[i].c_str()); ft.WriteLine(L" - Affected volumes by this component:"); for(unsigned i = 0; i < affectedVolumes.size(); i++) ft.WriteLine(L" - %s [%s]", affectedVolumes[i].c_str(), GetDisplayNameForVolume(affectedVolumes[i]).c_str()); // Print dependencies on Windows Server 2003 #ifdef VSS_SERVER ft.WriteLine(L" - Component Dependencies:"); for(unsigned i = 0; i < dependencies.size(); i++) dependencies[i].Print(); #endif }
// Print the properties for the given snasphot void VssClient::PrintSnapshotProperties(VSS_SNAPSHOT_PROP & prop) { FunctionTracer ft(DBG_INFO); LONG lAttributes = prop.m_lSnapshotAttributes; ft.WriteLine(L"* SNAPSHOT ID = " WSTR_GUID_FMT L" ...", GUID_PRINTF_ARG(prop.m_SnapshotId)); ft.WriteLine(L" - Shadow copy Set: " WSTR_GUID_FMT, GUID_PRINTF_ARG(prop.m_SnapshotSetId)); ft.WriteLine(L" - Original count of shadow copies = %d", prop.m_lSnapshotsCount); ft.WriteLine(L" - Original Volume name: %s [%s]", prop.m_pwszOriginalVolumeName, GetDisplayNameForVolume(prop.m_pwszOriginalVolumeName).c_str() ); ft.WriteLine(L" - Creation Time: %s", VssTimeToString(prop.m_tsCreationTimestamp).c_str()); ft.WriteLine(L" - Shadow copy device name: %s", prop.m_pwszSnapshotDeviceObject); ft.WriteLine(L" - Originating machine: %s", prop.m_pwszOriginatingMachine); ft.WriteLine(L" - Service machine: %s", prop.m_pwszServiceMachine); if (prop.m_lSnapshotAttributes & VSS_VOLSNAP_ATTR_EXPOSED_LOCALLY) ft.WriteLine(L" - Exposed locally as: %s", prop.m_pwszExposedName); else if (prop.m_lSnapshotAttributes & VSS_VOLSNAP_ATTR_EXPOSED_REMOTELY) { ft.WriteLine(L" - Exposed remotely as %s", prop.m_pwszExposedName); if (prop.m_pwszExposedPath && wcslen(prop.m_pwszExposedPath) > 0) ft.WriteLine(L" - Path exposed: %s", prop.m_pwszExposedPath); } else ft.WriteLine(L" - Not Exposed"); ft.WriteLine(L" - Provider id: " WSTR_GUID_FMT, GUID_PRINTF_ARG(prop.m_ProviderId)); // Display the attributes wstring attributes; if (lAttributes & VSS_VOLSNAP_ATTR_TRANSPORTABLE) attributes += wstring(L" Transportable"); if (lAttributes & VSS_VOLSNAP_ATTR_NO_AUTO_RELEASE) attributes += wstring(L" No_Auto_Release"); else attributes += wstring(L" Auto_Release"); if (lAttributes & VSS_VOLSNAP_ATTR_PERSISTENT) attributes += wstring(L" Persistent"); if (lAttributes & VSS_VOLSNAP_ATTR_CLIENT_ACCESSIBLE) attributes += wstring(L" Client_accessible"); if (lAttributes & VSS_VOLSNAP_ATTR_HARDWARE_ASSISTED) attributes += wstring(L" Hardware"); if (lAttributes & VSS_VOLSNAP_ATTR_NO_WRITERS) attributes += wstring(L" No_Writers"); if (lAttributes & VSS_VOLSNAP_ATTR_IMPORTED) attributes += wstring(L" Imported"); if (lAttributes & VSS_VOLSNAP_ATTR_PLEX) attributes += wstring(L" Plex"); if (lAttributes & VSS_VOLSNAP_ATTR_DIFFERENTIAL) attributes += wstring(L" Differential"); ft.WriteLine(L" - Attributes: %s", attributes.c_str()); ft.WriteLine(L""); }