SqlBak Blog

PostgreSQL DBMS – /bin/sh: 1: /usr/bin/psql: not found

If during setting up of SqlBak on Linux or during a backup job one of the following errors occurs:

PostgreSQL DBMS – /bin/sh: 1: /usr/bin/psql: not found
or
PostgreSQL DBMS – /bin/sh: 1: /usr/bin/pgdump: not found

it means that SqlBak app could not find the path to postgresql executables. By default, SqlBak looks for postgresql files in the /usr/bin/psql directory. 

How to fix the issue

To resolve the issue please follow these steps:

  1. Make sure that postgresql-client is installed

    To do this, please execute:

    psql -V

    the following response should be received:
    psql (PostgreSQL) 12.1 (Ubuntu 12.1-1.pgdg18.04+1)

    If you get an error message that the command was not found, install postgresql-client via the standard package manager. For Ubuntu, use this:

    sudo apt-get install postgresql-client

  2. Find the path where postgresql is installed:
    which psql
  3. Set a path to postgresql for SqlBak:
    sudo sqlbak -us -ps <your/path/to/psql>

2 thoughts on “PostgreSQL DBMS – /bin/sh: 1: /usr/bin/psql: not found”

  1. psql (PostgreSQL) 10.15 (Ubuntu 10.15-1.pgdg18.04+1)
    SqlBak application 1.1.48

    Job execution error: pg_dump: too many command-line arguments (first is kmuh_user_manager)
    Try pg_dump –help for more information.

    How to fix this problem? Thanks.

    Reply

Leave a Comment