我在 Linux 服务器上运行我的 python 脚本,当我使用 ssh 在远程终端上运行它时,它们运行成功。但是当我使用 crontab 文件运行命令时,它找不到安装在服务器中的某些文件。当我使用 cron 运行脚本时,它有什么不同?cron 文件与我的 python 脚本位于同一目录中。我正在使用安装在 postgresql installasion 文件夹中的“raster2pgsql”加载程序。错误信息是:
sh: raster2pgsql: not found
我的 cron 文件内容是:
*/2 * * * * /usr/bin/env python /home/testexe/LST.py >> /home/testexe/LST.log 2>&1