I am running a shell script by which we are scheduling a task using at command. But it schedules the at task but its not running the same beacuse its using shell /sbin/nologin when we are calling it from php code. It works fine if we run it from terminal.
我正在运行一个shell脚本,我们使用at命令调度任务。但是当我们从php代码调用它时,它会调度at任务,但是它运行不同,因为它使用shell / sbin / nologin。如果我们从终端运行它,它工作正常。
1 个解决方案
#1
1
You should check the "$PATH" env variable. When you are logged in from terminal the shell has initialized it's search path via .bashrc etc. "cron" or "at" jobs don't do that.
你应该检查“$ PATH”env变量。当您从终端登录时,shell已经通过.bashrc等初始化了它的搜索路径。“cron”或“at”作业不会这样做。
So try to log the environment variables to a file in your 'at' jobs and check if it is set up right.
因此,尝试将环境变量记录到“at”作业中的文件中,并检查它是否设置正确。
#1
1
You should check the "$PATH" env variable. When you are logged in from terminal the shell has initialized it's search path via .bashrc etc. "cron" or "at" jobs don't do that.
你应该检查“$ PATH”env变量。当您从终端登录时,shell已经通过.bashrc等初始化了它的搜索路径。“cron”或“at”作业不会这样做。
So try to log the environment variables to a file in your 'at' jobs and check if it is set up right.
因此,尝试将环境变量记录到“at”作业中的文件中,并检查它是否设置正确。