Linux计划任务

来自Org
跳转至: 导航搜索

您当前所在的位置:首页 > 架设手册 > Linux计划任务

192.168.0.184上的crontab例子:

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/root

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

# backup web files
00 5 * * * root /root/backup.sh > /dev/null 2>&1

# clean up the web file cache
30 0 * * * root /root/takeiteasy.sh >/dev/null 2>&1
# 0,20,40 * *  * * root /root/collect.sh &
0 */6 * * * root ntpdate pool.ntp.org > /var/log/ntp.log 2>&1

192.168.0.184上的rc.local例子:

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
/usr/local/apache2/bin/httpd -k start
mount -t nfs 192.168.0.156:/disk3 /mnt/nfs


关于“Linux计划任务”的留言:

目前暂无留言

新增相关留言