Script produces different result when executed by Bash than by cron

前端 未结 3 1998
不知归路
不知归路 2021-01-18 20:36

Please consider following crontab (root):

SHELL=/bin/bash
...
...
0 */3 * * * /var/maintenance/raid.sh

And the bash script /var/maint

3条回答
  •  一向
    一向 (楼主)
    2021-01-18 21:18

    cron tasks run in a shell that is started without your login scripts being run, which set up paths, environment variables etc.

    When building cron tasks, prefer things like absolute paths and explicit options etc

提交回复
热议问题