fedora8中添加cron定时任务
答案:1 悬赏:40 手机版
解决时间 2021-11-15 09:35
- 提问者网友:像風在裏
- 2021-11-14 14:50
fedora8中添加cron定时任务
最佳答案
- 五星知识达人网友:梦中风几里
- 2021-11-14 15:01
您好,
10 5 * * * root run-parts /etc/cron.daily
然后我们到
/etc/crond.daily
目录中创建两个文件,一个是用来重启
httpd
服
务器的,如下;
10 5 * * * root run-parts /etc/cron.daily
然后我们到
/etc/crond.daily
目录中创建两个文件,一个是用来重启
httpd
服
务器的,如下;
[root@localhost cron.daily]# touch httpd.sh
[root@localhost cron.daily]# chmod 755 httpd.sh
[root@localhost
cron.daily]#
echo
"/etc/init.d/httpd
restart"
>
httpd.sh
[root@localhost cron.daily]# more httpd.sh
/etc/init.d/httpd restart
如果我想在每天
5
点
20
分下载
FC5
的镜像,可以再创建一个文件
fc5down.sh
[root@localhost cron.daily]# touch fc5down.sh
[root@localhost cron.daily]# chmod 755 fc5down.sh
[root@localhost cron.daily]# echo "/usr/bin/wget
http://mirrors.kernel.org/fedora/core/5/i386/iso/FC-5-i386-DVD.iso" >
fc5down.sh
[root@localhost cron.daily]# more fc5down.sh
/usr/bin/wget
http://mirrors.kernel.org/fedora/core/5/i386/iso/FC-5-i386-DVD.iso
然后我们重新启动一下
crond
就行了;
[root@localhost cron.daily]# pkill crond
[root@localhost cron.daily]# prep crond
[root@localhost cron.daily]# crond&追问哥们,答非所问啊!!!
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯