本帖最后由 堡塔运维小林 于 2023-9-25 21:28 编辑
为了能快速了解并处理您的问题,请提供以下基础信息:
问题描述:终端运行py脚本正常,定时任务中运行却报错
相关截图(日志、错误):终端运行结果: [root@C20230828149494 tvbox]# python3 新 的 发 邮 件 .py
Email sent successfully
定时任务结果:
/www/wwwroot/iptv.lysvc.cc/tvbox/新的发邮件.py: line 1: import: command not found/www/wwwroot/iptv.lysvc.cc/tvbox/新的发邮件.py: line 2: from: command not found/www/wwwroot/iptv.lysvc.cc/tvbox/新的发邮件.py: line 3: from: command not found/www/wwwroot/iptv.lysvc.cc/tvbox/新的发邮件.py: line 4: from: command not found/www/wwwroot/iptv.lysvc.cc/tvbox/新的发邮件.py: line 5: import: command not found/www/wwwroot/iptv.lysvc.cc/tvbox/新的发邮件.py: line 8: mail_host: command not found/www/wwwroot/iptv.lysvc.cc/tvbox/新的发邮件.py: line 9: mail_user: command not found/www/wwwroot/iptv.lysvc.cc/tvbox/新的发邮件.py: line 10: mail_pass: command not found/www/wwwroot/iptv.lysvc.cc/tvbox/新的发邮件.py: line 11: sender: command not found/www/wwwroot/iptv.lysvc.cc/tvbox/新的发邮件.py: line 12: receivers: command not found/www/wwwroot/iptv.lysvc.cc/tvbox/新的发邮件.py: line 15: syntax error near unexpected token `('/www/wwwroot/iptv.lysvc.cc/tvbox/新的发邮件.py: line 15: `message = MIMEMultipart()'----------------------------------------------------------------------------★[2023-09-25 18:55:43] Successful |