Granting the mega user rights to perform backup

Last Updated : Jan 23, 2023 |

About this task

To perform a passwordless server backup, grant the server database backup permission to the mega user.

Procedure

  1. Do one of the following:
    • Open the console on the active Configuration Server.

    • Use the SSH client to log in to the active Configuration Server.

  2. In the command prompt, run the following command:

    cd /home/mega

  3. To create and edit the .pgpass file, run the following command:

    vi .pgpass

  4. In the .pgpass file, add the following entry:

    <database hostname>:<port>:<database name>:<database user>:<database user password>

    • <database host> is the IP or VIP address of the database host server.

    • <port> is the server port number. The default value is 5432.

    • <database name> is the name of the database for which you create a backup. You can type an asterisk (*) to create a backup of all databases.

    • <database user> is the database username.

    • <database user password> is the database user password.

    For example, you can type the following:

    192.168.1.1:5432:*:postgres:dbuserpassword

  5. To save the file, run the following command:

    :wq!

  6. To grant backup permissions to the user, run the following command:

    sudo chmod 0600 .pgpass