简体   繁体   English

如何使用 crontab 每 10 分钟 RPi 运行一次 python 脚本

[英]How to use crontab to run a python script every 10 mins RPi

I was trying to run a python script every 10 minutes however, this didn't seen to work for me.我试图每 10 分钟运行一次 python 脚本,但是,这对我不起作用。 I will run through the steps of what I did below: 1. open crontab - 'crontab -e' 2. start a new line that says '10 * * * * python /home/pi/WeatherPi/production/getInfo.py'.我将完成我在下面所做的步骤: 1. 打开 crontab - 'crontab -e' 2. 开始一个新行,上面写着 '10 * * * * python /home/pi/WeatherPi/production/getInfo.py' . From what I have seen on the internet this should then run the script every 10 mins but it didn't seem to for me.从我在互联网上看到的情况来看,这应该每 10 分钟运行一次脚本,但对我来说似乎不是这样。

Thank you in advance for any replies, Jacob预先感谢您的任何答复,雅各布

To get crontab to run a task every 10 minutes you could type as follow:要让 crontab 每 10 分钟运行一次任务,您可以输入如下:

*/10 * * * * /path/to/command

or或者

*/10 * * * * /path/to/script

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM