- 论坛徽章:
- 0
|
我曾经用过的crontab:
# /etc/crontab - root's crontab for FreeBSD
#
# $FreeBSD: src/etc/crontab,v 1.32.34.1 2009/04/15 03:14:26 kensmith Exp $
#
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log
#
#minute hour mday month wday who command
#
*/5 * * * * root /usr/libexec/atrun
#cron build all servers,and mail to developers
0 23 * * * MyUserName /home/MyUserName/cronbuild
#
# Save some entropy so that /dev/random can re-seed on boot.
*/11 * * * * operator /usr/libexec/save-entropy
#
# Rotate log files every hour, if necessary.
0 * * * * root newsyslog
#
# Perform daily/weekly/monthly maintenance.
1 3 * * * root periodic daily
15 4 * * 6 root periodic weekly
30 5 1 * * root periodic monthly
#
# Adjust the time zone if the CMOS clock keeps local time, as opposed to
# UTC time. See adjkerntz ( 8 ) for details.
1,31 0-5 * * * root adjkerntz -a
红色的一行是我添加的,意思是:每天晚上23点以MyUserName用户运行这个可执行文件:/home/MyUserName/cronbuild
cronbuild会编译我自己的程序,然后把编译结果当邮件发送到我自己的邮箱里面。
[ 本帖最后由 UnixStudier 于 2009-11-10 10:43 编辑 ] |
|