1 AUTHOR: Jim Gifford <lfs-hints at jg555.com>
5 LICENSE: GNU Free Documentation License Version 1.2
7 SYNOPSIS: Setup vixie-cron for LFS
9 DESCRIPTION: This will describe on how to setup vixie-cron for LFS.
15 Introduction to vixie-cron
17 Download location for vixie-cron
18 ftp://ftp.roedu.net/pub/mirrors/gentoo.org/distfiles
19 vixie-cron Version used 3.0.1
21 cron is a standard UNIX program that runs user-specified programs at
22 periodic scheduled times. vixie cron adds a number of features to the
23 basic UNIX cron, including better security and more powerful configuration
27 Required Patches for vixie-cron
29 In order to build vixie-cron, you will need to patch it. I have made patches
30 available and posted to patches.linuxfromscratch.org. The patch order listed
31 is critical to follow. At this point I have assumed that you have downloaded
32 the vixie-cron-3.0.1.tar.bz2 file and uncompressed it.
36 Patch 1 - vixie-cron-3.0.1-redhat-mdk-1.patch
37 Patch 2 - vixie-cron-3.0.1-security-1.patch
38 Patch 3 - vixie-cron-3.0.1-makefile-1.patch
39 Patch 4 - vixie-cron-3.0.1-variables-1.patch
43 Patch 5 - vixie-cron-3.0.1-pam-1.patch
45 These patches can be retrieved from
46 http://www.linuxfromscratch.org/patches/downloads/vixie-cron
48 ftp://ftp.jg555.com/pub/patches/vixie-cron
50 All patches can be installed using patch -Np1 -i NAME
53 Install vixie-cron by running the following commmands|
55 make CC="gcc $CFLAGS" &&
61 The cron daemon consults so-called crontabs for jobs to execute. These
62 crontabs are ordinary textfiles, however you should always use the crontab
63 tool to manipulate them.
65 To have a look at your crontab execute crontab -l. If a crontab exists then
66 it's contents is listed, otherwise "no crontab for <username>" will be
69 To add or delete an entry in your crontab, use crontab -e. Which editor is
70 used can be customized, but usually it's vi or whatever is in EDITOR variable.
72 You add or delete entries by adding or deleting the appropriate line in the
73 crontab (every entry takes exactly one line).
75 Each line consists of six columns which are seperated by blanks. The sixth
76 (rightmost) column tells cron which command/file to execute (always use the full
77 path here), while the other five columns tell cron when to execute it.
79 The columns (1 stands for the leftmost column, counting to the right) have the
80 following meaning and take the values in brackets:
86 Day of the week (0 - 6, 0 representing sunday, 6 saturday)
88 In each of these five columns an asterisk ("*") stands for "every".
89 Example: "41 5 * * * /home/jim/backupmeup.sh" would mean that everyday at 5:41
90 in the morning the script backmeup.sh in jim's home directory would be executed
91 (assuming, of course, that the script is executable).
93 If you want to specify a group of times, then concatenate the individual values,
94 seperated by commas (Example: "00,15,30,45" - in the first column this would read
95 as "every quarter of an hour on the quarter of the hour").
97 If you want to specify a range of times, you can use the minus (Example: "1-5"
98 in the fifth column would read as "every workday").
103 You can also create text files with the same information listed above in /etc/cron.d.
104 When you add a file to this directory, crond will sense the addition and add it to the
112 Make cron start on bootup
114 Create the /etc/rc.d/init.d/cron by running:
116 cat > /etc/rc.d/init.d/cron << "EOF"
118 # Begin $rc_base/init.d/cron - cron loader
120 # Based on sysklogd script from LFS-3.1 and earlier.
121 # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
123 source /etc/sysconfig/rc
128 echo "Starting Cron Scheduler..."
132 echo "Stopping Cron Schedular..."
134 rm -f /var/run/crond.pid
148 echo "Usage: $0 {start|stop|restart|status}"
153 # End $rc_base/init.d/cron
157 Make the script executable and create the appropriate symlinks by
160 chmod 755 /etc/rc.d/init.d/cron &&
161 ln -s /etc/rc.d/init.d/cron /etc/rc.d/rc0.d/K08cron &&
162 ln -s /etc/rc.d/init.d/cron /etc/rc.d/rc2.d/S40cron &&
163 ln -s /etc/rc.d/init.d/cron /etc/rc.d/rc3.d/S40cron &&
164 ln -s /etc/rc.d/init.d/cron /etc/rc.d/rc4.d/S40cron &&
165 ln -s /etc/rc.d/init.d/cron /etc/rc.d/rc5.d/S40cron &&
166 ln -s /etc/rc.d/init.d/cron /etc/rc.d/rc6.d/K08cron
170 CHANGELOG: 1.1 Fixed Typos (Thanx Thomas Trepl)
173 New Version of this document can be viewed from http://cvs.jg555.com/viewcvs.cgi/lfs-hints