{
    "content": [
        {
            "type": "text",
            "text": "# pg_verifybackup(1) (man)\n\n**Summary:** pgverifybackup - verify the integrity of a base backup of a PostgreSQL cluster\n\n**Synopsis:** pgverifybackup [option...]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -e | — | — |  |\n| — | --exit-on-error | — | Exit as soon as a problem with the backup is detected. If this option is not specified, pgverifybackup will continue che |\n| -i | — | — | --ignore=path Ignore the specified file or directory, which should be expressed as a relative path name, when comparing  |\n| -m | — | — | --manifest-path=path Use the manifest file at the specified path, rather than one located in the root of the backup dire |\n| -n | — | — |  |\n| — | --no-parse-wal | — | Don't attempt to parse write-ahead log data that will be needed to recover from this backup. |\n| -q | — | — |  |\n| — | --quiet | — | Don't print anything when a backup is successfully verified. |\n| -s | — | — |  |\n| — | --skip-checksums | — | Do not verify data file checksums. The presence or absence of files and the sizes of those files will still be checked.  |\n| -w | — | — | --wal-directory=path Try to parse WAL files stored in the specified directory, rather than in pgwal. This may be useful  |\n| -V | — | — |  |\n| — | --version | — | Print the pgverifybackup version and exit. -? |\n| — | --help | — | Show help about pgverifybackup command line arguments, and exit. |\n\n## Examples\n\n- `To create a base backup of the server at mydbserver and verify the integrity of the backup:`\n- `$ pgbasebackup -h mydbserver -D /usr/local/pgsql/data`\n- `$ pgverifybackup /usr/local/pgsql/data`\n- `To create a base backup of the server at mydbserver, move the manifest somewhere outside the`\n- `backup directory, and verify the backup:`\n- `$ pgbasebackup -h mydbserver -D /usr/local/pgsql/backup1234`\n- `$ mv /usr/local/pgsql/backup1234/backupmanifest /my/secure/location/backupmanifest.1234`\n- `$ pgverifybackup -m /my/secure/location/backupmanifest.1234 /usr/local/pgsql/backup1234`\n- `To verify a backup while ignoring a file that was added manually to the backup directory, and`\n- `also skipping checksum verification:`\n- `$ pgbasebackup -h mydbserver -D /usr/local/pgsql/data`\n- `$ edit /usr/local/pgsql/data/note.to.self`\n- `$ pgverifybackup --ignore=note.to.self --skip-checksums /usr/local/pgsql/data`\n\n## See Also\n\n- pgbasebackup(1)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (51 lines)\n- **OPTIONS** (2 lines) — 14 subsections\n  - -e (1 lines)\n  - --exit-on-error (4 lines)\n  - -i (8 lines)\n  - -m (4 lines)\n  - -n (1 lines)\n  - --no-parse-wal (3 lines)\n  - -q (1 lines)\n  - --quiet (2 lines)\n  - -s (1 lines)\n  - --skip-checksums (4 lines)\n  - -w (6 lines)\n  - -V (1 lines)\n  - --version (3 lines)\n  - --help (2 lines)\n- **EXAMPLES** (19 lines)\n- **SEE ALSO** (5 lines)\n\n## Full Content\n\n### NAME\n\npgverifybackup - verify the integrity of a base backup of a PostgreSQL cluster\n\n### SYNOPSIS\n\npgverifybackup [option...]\n\n### DESCRIPTION\n\npgverifybackup is used to check the integrity of a database cluster backup taken using\npgbasebackup against a backupmanifest generated by the server at the time of the backup.\nThe backup must be stored in the \"plain\" format; a \"tar\" format backup can be checked after\nextracting it.\n\nIt is important to note that the validation which is performed by pgverifybackup does not\nand cannot include every check which will be performed by a running server when attempting to\nmake use of the backup. Even if you use this tool, you should still perform test restores and\nverify that the resulting databases work as expected and that they appear to contain the\ncorrect data. However, pgverifybackup can detect many problems that commonly occur due to\nstorage problems or user error.\n\nBackup verification proceeds in four stages. First, pgverifybackup reads the backupmanifest\nfile. If that file does not exist, cannot be read, is malformed, or fails verification\nagainst its own internal checksum, pgverifybackup will terminate with a fatal error.\n\nSecond, pgverifybackup will attempt to verify that the data files currently stored on disk\nare exactly the same as the data files which the server intended to send, with some\nexceptions that are described below. Extra and missing files will be detected, with a few\nexceptions. This step will ignore the presence or absence of, or any modifications to,\npostgresql.auto.conf, standby.signal, and recovery.signal, because it is expected that these\nfiles may have been created or modified as part of the process of taking the backup. It also\nwon't complain about a backupmanifest file in the target directory or about anything inside\npgwal, even though these files won't be listed in the backup manifest. Only files are\nchecked; the presence or absence of directories is not verified, except indirectly: if a\ndirectory is missing, any files it should have contained will necessarily also be missing.\n\nNext, pgverifybackup will checksum all the files, compare the checksums against the values\nin the manifest, and emit errors for any files for which the computed checksum does not match\nthe checksum stored in the manifest. This step is not performed for any files which produced\nerrors in the previous step, since they are already known to have problems. Files which were\nignored in the previous step are also ignored in this step.\n\nFinally, pgverifybackup will use the manifest to verify that the write-ahead log records\nwhich will be needed to recover the backup are present and that they can be read and parsed.\nThe backupmanifest contains information about which write-ahead log records will be needed,\nand pgverifybackup will use that information to invoke pgwaldump to parse those write-ahead\nlog records. The --quiet flag will be used, so that pgwaldump will only report errors,\nwithout producing any other output. While this level of verification is sufficient to detect\nobvious problems such as a missing file or one whose internal checksums do not match, they\naren't extensive enough to detect every possible problem that might occur when attempting to\nrecover. For instance, a server bug that produces write-ahead log records that have the\ncorrect checksums but specify nonsensical actions can't be detected by this method.\n\nNote that if extra WAL files which are not required to recover the backup are present, they\nwill not be checked by this tool, although a separate invocation of pgwaldump could be used\nfor that purpose. Also note that WAL verification is version-specific: you must use the\nversion of pgverifybackup, and thus of pgwaldump, which pertains to the backup being\nchecked. In contrast, the data file integrity checks should work with any version of the\nserver that generates a backupmanifest file.\n\n### OPTIONS\n\npgverifybackup accepts the following command-line arguments:\n\n#### -e\n\n#### --exit-on-error\n\nExit as soon as a problem with the backup is detected. If this option is not specified,\npgverifybackup will continue checking the backup even after a problem has been detected,\nand will report all problems detected as errors.\n\n#### -i\n\n--ignore=path\nIgnore the specified file or directory, which should be expressed as a relative path\nname, when comparing the list of data files actually present in the backup to those\nlisted in the backupmanifest file. If a directory is specified, this option affects the\nentire subtree rooted at that location. Complaints about extra files, missing files, file\nsize differences, or checksum mismatches will be suppressed if the relative path name\nmatches the specified path name. This option can be specified multiple times.\n\n#### -m\n\n--manifest-path=path\nUse the manifest file at the specified path, rather than one located in the root of the\nbackup directory.\n\n#### -n\n\n#### --no-parse-wal\n\nDon't attempt to parse write-ahead log data that will be needed to recover from this\nbackup.\n\n#### -q\n\n#### --quiet\n\nDon't print anything when a backup is successfully verified.\n\n#### -s\n\n#### --skip-checksums\n\nDo not verify data file checksums. The presence or absence of files and the sizes of\nthose files will still be checked. This is much faster, because the files themselves do\nnot need to be read.\n\n#### -w\n\n--wal-directory=path\nTry to parse WAL files stored in the specified directory, rather than in pgwal. This may\nbe useful if the backup is stored in a separate location from the WAL archive.\n\nOther options are also available:\n\n#### -V\n\n#### --version\n\nPrint the pgverifybackup version and exit.\n\n-?\n\n#### --help\n\nShow help about pgverifybackup command line arguments, and exit.\n\n### EXAMPLES\n\nTo create a base backup of the server at mydbserver and verify the integrity of the backup:\n\n$ pgbasebackup -h mydbserver -D /usr/local/pgsql/data\n$ pgverifybackup /usr/local/pgsql/data\n\nTo create a base backup of the server at mydbserver, move the manifest somewhere outside the\nbackup directory, and verify the backup:\n\n$ pgbasebackup -h mydbserver -D /usr/local/pgsql/backup1234\n$ mv /usr/local/pgsql/backup1234/backupmanifest /my/secure/location/backupmanifest.1234\n$ pgverifybackup -m /my/secure/location/backupmanifest.1234 /usr/local/pgsql/backup1234\n\nTo verify a backup while ignoring a file that was added manually to the backup directory, and\nalso skipping checksum verification:\n\n$ pgbasebackup -h mydbserver -D /usr/local/pgsql/data\n$ edit /usr/local/pgsql/data/note.to.self\n$ pgverifybackup --ignore=note.to.self --skip-checksums /usr/local/pgsql/data\n\n### SEE ALSO\n\npgbasebackup(1)\n\n\n\nPostgreSQL 14.23                                2026                              PGVERIFYBACKUP(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "pg_verifybackup",
        "section": "1",
        "mode": "man",
        "summary": "pgverifybackup - verify the integrity of a base backup of a PostgreSQL cluster",
        "synopsis": "pgverifybackup [option...]",
        "flags": [
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--exit-on-error",
                "arg": null,
                "description": "Exit as soon as a problem with the backup is detected. If this option is not specified, pgverifybackup will continue checking the backup even after a problem has been detected, and will report all problems detected as errors."
            },
            {
                "flag": "-i",
                "long": null,
                "arg": null,
                "description": "--ignore=path Ignore the specified file or directory, which should be expressed as a relative path name, when comparing the list of data files actually present in the backup to those listed in the backupmanifest file. If a directory is specified, this option affects the entire subtree rooted at that location. Complaints about extra files, missing files, file size differences, or checksum mismatches will be suppressed if the relative path name matches the specified path name. This option can be specified multiple times."
            },
            {
                "flag": "-m",
                "long": null,
                "arg": null,
                "description": "--manifest-path=path Use the manifest file at the specified path, rather than one located in the root of the backup directory."
            },
            {
                "flag": "-n",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--no-parse-wal",
                "arg": null,
                "description": "Don't attempt to parse write-ahead log data that will be needed to recover from this backup."
            },
            {
                "flag": "-q",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--quiet",
                "arg": null,
                "description": "Don't print anything when a backup is successfully verified."
            },
            {
                "flag": "-s",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--skip-checksums",
                "arg": null,
                "description": "Do not verify data file checksums. The presence or absence of files and the sizes of those files will still be checked. This is much faster, because the files themselves do not need to be read."
            },
            {
                "flag": "-w",
                "long": null,
                "arg": null,
                "description": "--wal-directory=path Try to parse WAL files stored in the specified directory, rather than in pgwal. This may be useful if the backup is stored in a separate location from the WAL archive. Other options are also available:"
            },
            {
                "flag": "-V",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--version",
                "arg": null,
                "description": "Print the pgverifybackup version and exit. -?"
            },
            {
                "flag": "",
                "long": "--help",
                "arg": null,
                "description": "Show help about pgverifybackup command line arguments, and exit."
            }
        ],
        "examples": [
            "To create a base backup of the server at mydbserver and verify the integrity of the backup:",
            "$ pgbasebackup -h mydbserver -D /usr/local/pgsql/data",
            "$ pgverifybackup /usr/local/pgsql/data",
            "To create a base backup of the server at mydbserver, move the manifest somewhere outside the",
            "backup directory, and verify the backup:",
            "$ pgbasebackup -h mydbserver -D /usr/local/pgsql/backup1234",
            "$ mv /usr/local/pgsql/backup1234/backupmanifest /my/secure/location/backupmanifest.1234",
            "$ pgverifybackup -m /my/secure/location/backupmanifest.1234 /usr/local/pgsql/backup1234",
            "To verify a backup while ignoring a file that was added manually to the backup directory, and",
            "also skipping checksum verification:",
            "$ pgbasebackup -h mydbserver -D /usr/local/pgsql/data",
            "$ edit /usr/local/pgsql/data/note.to.self",
            "$ pgverifybackup --ignore=note.to.self --skip-checksums /usr/local/pgsql/data"
        ],
        "see_also": [
            {
                "name": "pgbasebackup",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pgbasebackup/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 51,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 2,
                "subsections": [
                    {
                        "name": "-e",
                        "lines": 1,
                        "flag": "-e"
                    },
                    {
                        "name": "--exit-on-error",
                        "lines": 4,
                        "long": "--exit-on-error"
                    },
                    {
                        "name": "-i",
                        "lines": 8,
                        "flag": "-i"
                    },
                    {
                        "name": "-m",
                        "lines": 4,
                        "flag": "-m"
                    },
                    {
                        "name": "-n",
                        "lines": 1,
                        "flag": "-n"
                    },
                    {
                        "name": "--no-parse-wal",
                        "lines": 3,
                        "long": "--no-parse-wal"
                    },
                    {
                        "name": "-q",
                        "lines": 1,
                        "flag": "-q"
                    },
                    {
                        "name": "--quiet",
                        "lines": 2,
                        "long": "--quiet"
                    },
                    {
                        "name": "-s",
                        "lines": 1,
                        "flag": "-s"
                    },
                    {
                        "name": "--skip-checksums",
                        "lines": 4,
                        "long": "--skip-checksums"
                    },
                    {
                        "name": "-w",
                        "lines": 6,
                        "flag": "-w"
                    },
                    {
                        "name": "-V",
                        "lines": 1,
                        "flag": "-V"
                    },
                    {
                        "name": "--version",
                        "lines": 3,
                        "long": "--version"
                    },
                    {
                        "name": "--help",
                        "lines": 2,
                        "long": "--help"
                    }
                ]
            },
            {
                "name": "EXAMPLES",
                "lines": 19,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}