CRON(8) FreeBSD System Manager's Manual CRON(8)
NAME
cron - daemon to execute scheduled commands (Vixie Cron)
SYNOPSIS
cron [-x debugflag[,...]]
DESCRIPTION
Cron should be started from /etc/rc or /etc/rc.local. It will return im-
mediately, so you don't need to start it with '&'.
Cron searches /var/cron/tabs for crontab files which are named after ac-
counts in /etc/passwd; crontabs found are loaded into memory. Cron also
searches for /etc/crontab which is in a different format (see
crontab(5)). Cron then wakes up every minute, examining all stored
crontabs, checking each command to see if it should be run in the current
minute. When executing commands, any output is mailed to the owner of
the crontab (or to the user named in the MAILTO environment variable in
the crontab, if such exists).
Additionally, cron checks each minute to see if its spool directory's
modtime (or the modtime on /etc/crontab) has changed, and if it has, cron
will then examine the modtime on all crontabs and reload those which have
changed. Thus cron need not be restarted whenever a crontab file is mod-
ified. Note that the crontab(1) command updates the modtime of the spool
directory whenever it changes a crontab.
SEE ALSO
crontab(1), crontab(5)
AUTHORS
Paul Vixie
BSD December 20, 1993 1
Under 'SEE ALSO' are 'crontab(1) and crontab(5). The syntax for viewing 'crontab(5)' would be 'man 5 crontab'. This syntax is not readily apparent, and in versions of shipped with FreeBSD 3.4 and earlier, is not covered in the 'man' page for 'man' itself!
NOTE: This was corrected in later man editions
The easy solution is to use pico, a user-friendly, menu-driven simple text editor. To make this your default, you edit the initialization files that are read when you login. If your login shell is 'csh' or 'tcsh', the file to edit is called '.cshrc'. Type 'pico .cshrc' and edit the 'EDITOR' environment variable; change 'vi' to 'pico'. You should make the same change to '.login'. You can make this new default take effect immediately by the commands 'source .cshrc' and 'source .login' (it will also become the default when you logout and log back in). If you're using the Bourne or Korn shells or BASH, you change the EDITOR environment variable in '.profile' which is used by those shells.
# DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.Hztvs11699 installed on Thu Dec 16 16:24:23 1999) # (Cron version -- $Id: crontab.c,v 1.6.2.3 1998/03/09 11:42:00 jkh Exp $) MAILTO="johnpipe@nwserv.com" PATH=/usr/bin:/bin:/usr/home/parvifox/bin 1 1 * * 1 sklogs
The MAILTO variable will allow the cron daemon to send email error notification to me on my personal account, which is on a different server than that on which the crontab is running. The PATH variable lets the cron program know where to find the program to run; in this case, it is 'sklogs', a shell script in /usr/home/parvifox/bin/. You can find the full details using 'man crontab' and accessing the different numbered pages listed under SEE ALSO.
Note that crontab expects each command or environment variable to be on a separate line; this means that, if you are using pico, you cannot write a command line longer than the maximum line length for pico. By using a script for the programming details, this problem is obviated. You could, of course, learn vi, which can write very long lines! This is actually a very good thing to do; vi is installed on just about every unix-type system in the world, and although a little hard for some of us to learn, is very fast once you get the hang of it. I used it in Feb 2K to update this page. Search for (it may even be installed on your system) "vi tutor" or tutor.vi on the www. Also, on Linux systems type "vimtutor".
I should also mention that on the freeBSD CD there is "ee" (easy edit), a more capable editor than pico that can handle longer lines.
FAST STARTUP
This section will tell you the minimum amount that you
need to do simple editing tasks using vi. If you've never
used any screen editor before, you're likely to have prob-
lems even with this simple introduction. In that case you
should find someone that already knows vi and have them
walk you through this section.
In my case, as the ISP I had at the time used dynamic IP assignment, I got a simple script entry from them for my .login script file [for tcsh] which queried the dynamically assigned IP after login and assigned it to the variable DISPLAY ,which gets used by xterm to know where is the x terminal to connect to (if this variable is set, emacs will detect it and try to run as an X client unless the '-nw' command-line switch is used). A simple command, xwin, is implemented via a script in my $HOME/bin directory which starts the x connection with the x server on my PC.
Here's what the .login looked like:
# $FreeBSD: src/share/skel/dot.login,v 1.11.2.1 1999/08/29 16:47:50 peter Exp $
#
# .login - csh login script, read by login shell,
# after `.cshrc' at login.
#
# see also csh(1), environ(7).
#
set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/bin /usr/X11R6/bin $HOME/bin)
setenv MANPATH "/usr/share/man:/usr/X11R6/man:/usr/local/man"
set ipaddress = `w -h -i -n $USER | head -1 | awk '{ print $3 }' | sed -e's/:.*$//g'`
setenv DISPLAY ${ipaddress}:0
# Interviews settings
#setenv CPU "FREEBSD"
#set path = ($path /usr/local/interviews/bin/$CPU)
#setenv MANPATH "${MANPATH}:/usr/local/interviews/man"
# A rightous umask
umask 22
Here's the script 'xwin':
xterm -fn 12x24 &
which gives a decently large font size which I can read without glasses. The "-fn [fontname] &" command options mean "use the font named '12x24' and run in the background". In the case of the X-server I used (Xwin32) the fonts are those which are stored on the PC in the server's font library folder. This script is executed from my login shell.
Created 17 December 1999
Revised 29 May 2002