15.5 其他单文件备份操作

除了用于创建和恢复单文件备份的命令(即backup-to-imagecopy-back-and-apply-log)之外, mysqlbackup还提供了许多其他命令供您使用单文件备份。它们在下面解释。

mysqlbackup [STD-OPTIONS]
            [--backup-image=IMAGE] [--backup-dir=PATH]
            [MESSAGE-LOGGING-OPTIONS]    
            [PROGRESS-REPORT-OPTIONS]
            [ENCRYPTION-OPTIONS]
            [CLOUD-STORAGE-OPTIONS]
            image-to-backup-dir

mysqlbackup [STD-OPTIONS]
            [--backup-dir=PATH] [--backup-image=IMAGE]
            [MESSAGE-LOGGING-OPTIONS]
            [PROGRESS-REPORT-OPTIONS]
            [ENCRYPTION-OPTIONS]
            [CLOUD-STORAGE-OPTIONS]
            backup-dir-to-image

mysqlbackup [STD-OPTIONS]
            [--backup-image=IMAGE]
            [MESSAGE-LOGGING-OPTIONS]
            [ENCRYPTION-OPTIONS]
            [CLOUD-STORAGE-OPTIONS]
            list-image

mysqlbackup [STD-OPTIONS]
            [--backup-image=IMAGE]
            [--backup-dir=PATH]
            [--src-entry=PATH] [--dst-entry=PATH]
            [--uncompress]
            [MESSAGE-LOGGING-OPTIONS]
            [PROGRESS-REPORT-OPTIONS]
            [ENCRYPTION-OPTIONS]
            [CLOUD-STORAGE-OPTIONS]
            extract
  • backup-dir-to-image

    将现有备份目录打包到单个文件中。参数的值--backup-image应该是-(代表标准输出)或 backup-dir目录外的绝对路径。指定 --backup-image-(标准输出)以将现有备份目录结构流式传输到磁带设备或将备份传输到另一台服务器的命令。有关用法示例,请参阅第 4.3.1 节,“制作单个文件备份”

  • extract

    Unpacks individual files or directories from a single-file backup. It is useful for troubleshooting, or for restorations that do not require the full set of backup data. The resulting file or directory goes into the current directory, or into the backup directory, if specified with --backup-dir; in either case, the destination directory must be empty. For usage examples, see Section 4.3.1, “Making a Single-File Backup”.

    The --src-entry=string option can be used for selective extraction of files or directories whose path names in the image contain the string specified with the option.

    Notes
    • Some items are always extracted from the backup; see the descriptions of --src-entry for details.

    • The option is currently not supported for the extraction of cloud backups, which can only be extracted in full.

    The --dst-entry=path option, along with --src-entry=path option, can be used to extract files or directories into user-specified locations; see the description for the option for details.

    For MySQL Enterprise Backup 4.1.4 and later: Use the --uncompress option to extract files from a compressed single-file backup.

    The default destination for the extract is the current working directory. All the files with relative pathnames in the image are extracted to pathnames relative to the destination directory. If the image contains some entries with absolute pathnames, those entries are extracted to the same absolute pathnames on the local system even if the --backup-dir option is specified. The --dst-entry option must be used to relocate an absolute pathname; see Example 4.12, “Dealing with Absolute Path Names”.

    Important

    即使从备份映像中提取了所有文件, 也extract只会创建一个 原始备份 目录,该目录还没有准备好通过 copy-back命令恢复。要成为 准备好的备份,备份目录必须通过 应用日志操作,由独立 apply-log命令或作为命令的一部分copy-back-and-apply-log 执行。