Log Shipping on SQL Server 2019 on Linux

Pepe-8078 0 Reputation points
2024-04-25T18:11:39.8466667+00:00

I am attempting to set up log shipping in docker containers. I was able to set up the samba share and get everything setup and jobs deployed to both primary and secondary servers where the logs will be shipped. I think I have narrowed down the issue to how the SQL Server agent on Linux tries to execute the command to make the transaction log backup. Here is the error message from the agent:

Executed as user: NT AUTHORITY\NETWORK SERVICE. Incorrect syntax near 'c:\Tools\Binn\sqllogship.exe'. [SQLSTATE 42000] (Error 102). The step failed.

There is nowhere to execute the command as cmdexe or \sqllogship.exe" under the type for the backup job.

  1. Docker Version: 26.0.1
  2. OS: Rocky Linux 9.3
  3. SQL Server Version: 16.0.4120.1

User's image

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,854 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Erland Sommarskog 102.2K Reputation points
    2024-04-25T21:07:17.4666667+00:00

    From a T-SQL job step you are trying to a command-line operation. That is of course not going to work out.

    If you don't have access to the option to run a cmdExec task, you will need to look into something else. I guess you run the job from cron just as well.


  2. LucyChenMSFT-4874 1,280 Reputation points
    2024-04-26T06:00:39.6533333+00:00

    Hi @Pepe-8078,

    Thanks for your information.

    Could you please ensure you are backing up a transaction log correctly? The screenshot you provided shows you are trying to a command-line operation from T-SQL job.

    Have you ever checked the answer of Erland Sommarskog? After you check out the article I provided, I think you can try the method he suggested to resolve the issue.

    If you have any concerns, please feel free to share with us.

    Best regards,

    Lucy Chen


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    https://docs.microsoft.com/en-us/answers/support/email-notifications


  3. LucyChenMSFT-4874 1,280 Reputation points
    2024-04-29T06:25:11.51+00:00

    Hi @Pepe-8078,

    Thanks for your feedback.

    the question is how do you set up SQL Sever Log Shipping in a docker container.

    I checked the official document of configuring the log shipping on Linux, you can learn more information about how to set it up from this article.

    In addition, the steps in this article are vague. I found another article which provide the steps more detailed, I think you can follow the article step by step to set up SQL Server Log Shipping on Linux.

    Hope the articles I provide can help you well.

    Feel free to share your issue here.

    Best regards,

    Lucy Chen


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    https://docs.microsoft.com/en-us/answers/support/email-notifications