鱼儿慢慢游~~

导航

 

1.linux 下添加定时任务

网上有很多定时任务的介绍,本篇主要介绍通过脚本添加定时任务的操作。
1.编写crond 需要的执行的脚本:
example.sh
echo "haha"

2. 编写cron 执行的脚本,example
1 * * * * root example.sh > /dev/null 2>&1

3. 在安装脚本 install.sh 中,将example 拷贝到/etc/cron.d中
cp -f example.sh /etc/crod.d/

执行:
crontab /etc/cron.d/example

posted on 2015-12-14 18:23  miss_UU  阅读(480)  评论(0编辑  收藏  举报