Joh*_*ith 1 python linux ubuntu cron
我有一个非常基本的python脚本,每分钟运行一次crontab.
剧本
filed = open('test.txt','a')
Run Code Online (Sandbox Code Playgroud)
crontab的
* * * * * /to path the file/job.py
Run Code Online (Sandbox Code Playgroud)
它应该工作,但我无法看到结果.那么,可能是什么问题呢?
你需要text.txt
使用绝对路径打开; crondaemon可能正在使用与你期望的不同的路径:
filed = open('/home/john/Desktop/test.txt','a')
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
188 次 |
最近记录: |