任务1: 每隔1分钟,运行一次 /home/sn/yeelink.sh文件 ,用于上传数据到www.yeelink.net
1. 先在当时目录里面创建一个cronfile文件
vim cronfile
输入如下内容:
*/1 * * * * /home/sn/yeelink.sh
#其中这个 '*/1' 是最重要的,不要忘记了。
2. 使用crontab 加载cronfile
crontab cronfile
3. 检查一下,任务是否加入了列表当中
crontab -l
输入内容如下:
root@sn-pc:/home/sn# crontab -l 1 * * * * /home/sn/yeelink.sh
好了,至此完成了任务了。