[SOLVED] Scheduled Tasks giving "500 - Internal Server Error Failed to execute command" while script in terminal and crontab works fine

  • Hi everybody,


    I am not totally new to OMV, but until now I have only been using straight forward and easy cases.


    Due to some architectural changes I decied to reinstall OMV. I was using OMV 6 and did a brand new install from OMV ISO to OMV 7.1.0-2.

    After setting everything up as I documented, all services are working like a charm.


    The last thing I am having an issue with is:

    I am having 4 bash scripts which work fine while executed as root in a terminal (ssh) and while the job are planned with crontab. When setting up the same jobs with "System --> Scheduled Tasks" and starting them manually, I allways get the following error



    One example script is:


    When executing the script in Terminal the total runtime is about 8 to 9 minutes.


    I hope someone can help me with this.

    Regards.

  • chente

    Approved the thread.
  • Today I found the issue. It was due to wrong permissions on the pub/priv-Keys used for ssh authentication.

    Solution:

    Code
    # as user running the script, in my case root
    chmod 700 ~/.ssh
    chmod 600 ~/.ssh/*

    I don't really know why it worked while running the script manually. At the end I found it due to the lucky case I created a log-file "LOGFILE=/root/MakePleskFullBackup.log" :D


    Regards.

  • rolfe11-11

    Added the Label resolved
  • rolfe11-11

    Changed the title of the thread from “Scheduled Tasks giving "500 - Internal Server Error Failed to execute command" while script in terminal and crontab works fine” to “[SOLVED] Scheduled Tasks giving "500 - Internal Server Error Failed to execute command" while script in terminal and crontab works fine”.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!