python crontab makec冻结

2024-10-03 19:19:35 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在用python编写一个测试脚本 我的脚本中有一个'makec'命令。 我设置crontab每小时运行一次脚本, 下面是我使用的crontab命令(全部在一行中)

20 * * * * cd /project/work/account/auto_test/ ;   
/project/tools/bin/python3   
/project/work/lichuan/auto_test/revision.py  >> 
/project    /work/account/auto_test/crontab.txt 2>&1

这是我收到的电子邮件

/bin/sh: line 1: 19047 Terminated              
/project/tools/bin/python3 /project/work/account/auto_test/revision.py >>
/project/work/account/auto_test/crontab.txt 2>&1

似乎进程在'makec'命令处冻结,在此日志之后不再输出

/sirius/tools/python3/lib/python3.2/subprocess.py:389: RuntimeWarning: 
The _posixsubprocess module is not being used. 
Child process reliability may suffer if your program uses threads.

“程序使用线程。”,RuntimeWarning)

我以前在脚本中有过这个运行时警告,但效果很好,所以我不确定问题出在哪里。 现在看来,makec命令的问题仍然存在,但我在makec之前有一个cp命令,所以我认为os-lib没有问题

谢谢


Tags: pytest命令txtproject脚本autobin
1条回答
网友
1楼 · 发布于 2024-10-03 19:19:35

不管怎样,我想出来了。我们可以从其他网站了解到,我们需要配置文件的绝对路径。这同样适用于命令。在我为makec命令指定abs路径后,例如:

/tools/bin/makec   options

一切正常

相关问题 更多 >