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.结果

 

 

posted @ 2016-11-02 17:22  当自强  阅读(90)  评论(0编辑  收藏  举报