我正在使用 pytest 使用 python3 脚本运行我的测试,如下所示:
pytest -s test_file.py | tee -a myoutput.log
有用。现在我想在每天的特定时间运行它,我尝试从 Linux 控制台“crontab -e”但失败了。我的意思是没有日志添加到“myoutput.log”文件中。有人可以帮忙吗?谢谢!
42 00 * * * /usr/bin/pytest pytest -s /data/smc/test_file.py | tee -a myoutput.log
我认为可以通过使用 cron 输出来完成。例如:
42 00 * * * /usr/bin/pytest pytest -s /data/smc/test_file.py >> /Your-log-path.log 2>&1
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)