Working with Backups
Working with Backups

The Windows Home Server API provides ways to get important information about the state of Windows Home Server Backup as well as some of the properties of an individual backup.

Backup Example

Step 1: Create an instance of WHSInfoClass

To retrieve information about Windows Home Server Backup, you need to create an instance of the WHSInfoClass, as follows:

C#
WHSInfoClass pInfo = new WHSInfoClass();
Visual Basic
Dim pInfo As New WHSInfoClass()

This class contains all of the methods for retrieving Backup information.

Step 2 (Option 1): Call the WHSInfoClass.GetBackupStartTime() method

If you want to retrieve the start time of the next scheduled backup, use the GetBackupStartTime method:

C#
pInfo.GetBackupStartTime();
Visual Basic
pInfo.GetBackupStartTime()

This method takes no parameters, and it returns an unsigned integer that represents the starting time (calculated as minutes from midnight) for the next scheduled backup.

Step 2 (Option 2): Call the M:WHSInfoIF.WHSInfoClass.GetBackupEstimatedCompletionTime()

If you want to determine the backup window for Windows Home Server, use the GetBackupEstimatedCompletionTime method. The backup window is the time that is allotted for the scheduled nightly backups to occur. By default, this window is 12:00 A.M. (midnight) to 6:00 A.M., but the Windows Home Server administrator can configure it.

For example, your program may require the home server to reboot. To avoid rebooting during a backup, you can check to see if your program is running during the backup window.

Retrieve the time of the backup window time as follows:

C#
pInfo.GetBackupEstimatedCompletionTime();
Visual Basic
pInfo.GetBackupEstimatedCompletionTime()

The GetBackupEstimatedCompletionTime method takes no parameters, and it returns an unsigned integer that represents the backup window time (calculated as minutes from midnight) for the home server.

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
Page view tracker