linux 定时任务

1.编辑配置文件 sudocrontab -e

   */1 * * * * python /home/hello.py  >> /home/hello.log

   */1 * * * * date >> /home/hello.log

2.hello.py内容

print "hello"

3.保存,重启服务: /etc/init.d/cron restart

4.结果

 

原文地址:https://www.cnblogs.com/zhaokewei/p/6023714.html