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:

WHSInfoClass pInfo = new WHSInfoClass();
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:

pInfo.GetBackupStartTime();
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:

pInfo.GetBackupEstimatedCompletionTime();
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

Concepts

Extending Windows Home Server
Working with WHSInfoClass
Working with Client Computers
Working with Users
Working with Application Folders
Working with Managed Volumes
Working with Hard Disks
Working with Notifications

Other Resources

Working with Shared Folders