MS SQL Server DBMS – /bin/sh: 1: /opt/mssql-tools/bin/sqlcmd

If you get the following error message during SqlBak set up on Linux or during a backup job:

MS SQL Server DBMS – /bin/sh: 1: /opt/mssql-tools/bin/sqlcmd

it means that SqlBak app could not find the path to the msql executables. By default, SqlBak searches for mssql files in the /opt/mssql-tools/bin/sqlcmd directory.

How to resolve the issue

Please follow these step to resolve the issue:

  1. Make sure that sqlcmd is installed

    To do this, please execute:

    sqlcmd -?
    

    in response, you should get something similar to:
    Microsoft (R) SQL Server Command Line Tool
    Version 17.4.0001.1 Linux
    Copyright (c) 2012 Microsoft. All rights reserved.

    If you get an error message that the command was not found, then install sqlcmd through the standard package manager. For Ubuntu, this can be done like so:

    sudo apt-get install sqlcmd
  2. Find the path where sqlcmd is installed
    which sqlcmd
  3. Specify sqlcmd path for SqlBak
    sudo sqlbak -us -sq <your/path/to/sqlcmd>

Leave a Comment