编辑配置文件:
sudo crontab -e
选择编辑器:
select-editor
这里选择vim,然后编辑配置文件,做如下操作,来测试:
*/1 * * * * python /home/hello.py >> /home/hello.log
*/1 * * * * date >> /home/hello.log
保存,重启服务:
/etc/init.d/cron restart
每隔一分钟,写入hello.log文件一次。
hello.py中:
print "hello!!"
