Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
285 views
in Technique[技术] by (71.8m points)

Issue running python script every 24 hours using cron job


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Well, I don't know what your problem is but, I guess you did't set the PATH.

Try this,

  1. Run printenv | grep "PATH". (check your PATH)
  2. Add PATH to your crontab
PATH=/your/path

*/1 * * * * your_command

P.S
You can get a log from python script like
Users/myname/opt/anaconda3/bin/python main.py >> /log/file/path 2>&1


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...