wbadmin start backup(开始备份命令)

使用指定的参数创建备份。 如果未指定任何参数,并且已创建计划的每日备份,此命令将使用计划备份的设置创建备份。 如果指定了参数,它将创建卷影复制服务(VSS)复制备份,并且不会更新正在备份的文件的历史记录。

To create a one-time backup using this command, you must be a member of the Backup Operators group or the Administrators group, or you must have been delegated the appropriate permissions. In addition, you must run wbadmin from an elevated command prompt, by right-clicking Command Prompt, and then selecting Run as administrator.

Syntax

wbadmin start backup [-backupTarget:{<BackupTargetLocation> | <TargetNetworkShare>}] [-include:<ItemsToInclude>] [-nonRecurseInclude:<ItemsToInclude>] [-exclude:<ItemsToExclude>] [-nonRecurseExclude:<ItemsToExclude>] [-allCritical] [-systemState] [-noVerify] [-user:<UserName>] [-password:<Password>] [-noInheritAcl] [-vssFull | -vssCopy] [-quiet]

Parameters

Parameter Description
-backupTarget 指定此备份的存储位置。 需要硬盘驱动器驱动器号(f:)、卷 GUID 格式 \\?\Volume{GUID}的路径或远程共享文件夹 (\\<servername>\<sharename>\)的通用命名约定 (UNC) 路径。 默认情况下,备份将保存到: \\<servername>\<sharename>\WindowsImageBackup\<ComputerBackedUp>\
-include 指定要包含在备份中的项的逗号分隔列表。 可以包含多个文件、文件夹或卷。 可以使用卷驱动器号、卷装入点或基于 GUID 的卷名称来指定卷路径。 如果使用基于 GUID 的卷名称,则应使用反斜杠(\) 终止它。 指定文件的路径时,可以在文件名中使用通配符 (*)。 The -include parameter should only be used in conjunction with the -backupTarget parameter.
-exclude 指定要从备份中排除的以逗号分隔的项列表。 可以排除文件、文件夹或卷。 可以使用卷驱动器号、卷装入点或基于 GUID 的卷名称来指定卷路径。 如果使用基于 GUID 的卷名称,则应使用反斜杠(\) 终止它。 指定文件的路径时,可以在文件名中使用通配符 (*)。 The -exclude parameter should only be used in conjunction with the -backupTarget parameter.
-nonRecurseInclude 指定要包含在备份中的项的非递归逗号分隔列表。 可以包含多个文件、文件夹或卷。 可以使用卷驱动器号、卷装入点或基于 GUID 的卷名称来指定卷路径。 如果使用基于 GUID 的卷名称,则应使用反斜杠(\) 终止它。 指定文件的路径时,可以在文件名中使用通配符 (*)。 The -nonRecurseInclude parameter should only be used in conjunction with the -backupTarget parameter.
-nonRecurseExclude 指定要从备份中排除的项的非递归逗号分隔列表。 可以排除文件、文件夹或卷。 可以使用卷驱动器号、卷装入点或基于 GUID 的卷名称来指定卷路径。 如果使用基于 GUID 的卷名称,则应使用反斜杠(\) 终止它。 指定文件的路径时,可以在文件名中使用通配符 (*)。 The -nonRecurseExclude parameter should only be used in conjunction with the -backupTarget parameter.
-allCritical 指定备份中包含所有关键卷(包含作系统状态的卷)。 如果要为裸机恢复创建备份,此参数非常有用。 It should be used only when -backupTarget is specified, otherwise the command fails. Can be used with the -include option.

Tip: The target volume for a critical-volume backup can be a local drive, but it Can't be any of the volumes that are included in the backup.

-systemState Creates a backup that includes the system state in addition to any other items that you specified with the -include parameter. 系统状态包含启动文件(Boot.ini、NDTLDR、NTDetect.com)、Windows 注册表,包括 COM 设置、SYSVOL(组策略和登录脚本)、Active Directory 和 NTDS。域控制器上的 DIT,如果安装了证书服务,则证书存储。 如果服务器安装了 Web 服务器角色,将包含 IIS 元目录。 如果服务器是群集的一部分,则还会包含群集服务信息。
-noVerify 指定保存到可移动媒体(如 DVD)的备份未验证是否出错。 如果不使用此参数,将验证保存到可移动媒体的备份是否存在错误。
-user 如果备份保存到远程共享文件夹,则指定具有对文件夹的写入权限的用户名。
-password Specifies the password for the user name that is provided by the parameter -user.
-noInheritAcl Applies the access control list (ACL) permissions that correspond to the credentials provided by the -user and -password parameters to \\<servername>\<sharename>\WindowsImageBackup\<ComputerBackedUp>\ (the folder that contains the backup). 若要稍后访问备份,必须使用这些凭据或作为具有共享文件夹的计算机上的管理员组或备份作员组的成员。 If -noInheritAcl is not used, the ACL permissions from the remote shared folder are applied to the \<ComputerBackedUp> folder by default so that anyone with access to the remote shared folder can access the backup.
-vssFull 使用卷影复制服务(VSS)执行完全备份。 所有文件都已备份,每个文件的历史记录都会更新,以反映其已备份,并且以前的备份日志可能会被截断。 如果未使用此参数, wbadmin 启动备份 会进行复制备份,但要备份的文件的历史记录不会更新。

Caution: Don't use this parameter if you are using a product other than Windows Server Backup to back up apps that are on the volumes included in the current backup. 这样做可能会破坏另一个备份产品正在创建的增量备份、差异备份或其他类型的备份,因为它们依赖的历史记录来确定备份可能丢失的数据量,并且可能会不必要地执行完整备份。

-vssCopy 使用 VSS 执行复制备份。 所有文件都已备份,但正在备份的文件的历史记录不会更新,因此可以保留更改、删除等文件以及任何应用程序日志文件的所有信息。 使用此类型的备份不会影响可能与此复制备份无关的增量备份和差异备份序列。 这是默认值。

Warning: A copy backup can't be used for incremental or differential backups or restores.

-quiet 在不提示用户的情况下运行该命令。

Remarks

  • 如果将备份保存到远程共享文件夹,然后对同一台计算机和同一远程共享文件夹执行另一个备份,则将覆盖以前的备份。

  • 如果备份作失败,则最终无需备份,因为旧备份被覆盖,但较新的备份不可用。 为了避免这种情况,我们建议在远程共享文件夹中创建子文件夹来组织备份。 但是,由于此组织,你必须有两倍的空间作为父文件夹可用。

Examples

To create a backup of volumes e:, d:\mountpoint, and \\?\Volume{cc566d14-4410-11d9-9d93-806e6f6e6963}\ to volume f:, type:

wbadmin start backup -backupTarget:f: -include:e:,d:\mountpoint,\\?\Volume{cc566d14-44a0-11d9-9d93-806e6f6e6963}\

To perform a one-time backup of f:\folder1 and h:\folder2 to volume d:, to backup the system state, and to make a copy backup so the normally scheduled differential backup isn't impacted, type:

wbadmin start backup –backupTarget:d: -include:g\folder1,h:\folder2 –systemstate -vsscopy

To perform a one-time, non-recursive backup of d:\folder1 to the \\backupshare\backup1* network location, and to restrict access to members of the Administrators or Backup Operators group, type:

wbadmin start backup –backupTarget: \\backupshare\backup1 -noinheritacl -nonrecurseinclude:d:\folder1