作者:wing96333 | 来源:互联网 | 2023-05-19 16:05
Ihavetriedexportingmypathsandvariablesandcrontabstillwillnotrunmyscript.ImsureIa
I have tried exporting my paths and variables and crontab still will not run my script. I'm sure I am doing something wrong.
我已经尝试导出我的路径和变量,而crontab仍然不会运行我的脚本。我确定我做错了什么。
I have a shell script which runs a jar file. This is not working correctly.
我有一个运行jar文件的shell脚本。这不能正常工作。
After reading around I have read this is commonly due to incorrect paths due to cron running via its own shell instance and therefore does not have the same preferences setup as my profile does.
阅读后我读到这通常是由于cron通过自己的shell实例运行而导致的路径不正确,因此没有与我的配置文件相同的首选项设置。
Here is what my script looks like today after several modifications:
以下是经过多次修改后我的脚本今天的样子:
#!/bin/bash --
. /root/.bash_profile
/usr/bin/java -jar Pharmagistics_auto.jar -o
...
those are the most important pieces of the script, the rest are straightforward shell based.
那些是脚本中最重要的部分,其余部分都是基于shell的。
Can someone tell me what I am doing wrong?
有人能告诉我我做错了什么吗?
6 个解决方案