[Techtalk] crontab vs vi

Laurel Fan laurel at sdf.lonestar.org
Fri Jan 11 19:10:06 EST 2002


The manpage for crontab on my solaris box says:
           Note  that all crontab jobs should be
           submitted using crontab; you should not  add  jobs  by
           just editing the crontab file because cron will not be
           aware of changes made this way.

Also, my crontab seems to be owned by root, so using crontab is the
only way I can edit it.

Most edit-the-config-file commands provide locking[1] and/or syntax
checking[2].  Others I can think of are visudo[3], vipw[4],
vigr[5]. (Despite the names, these don't make you use vi; they read
the EDITOR environment variable).

[1] Locking is telling whatever uses the config file to not read it
while you're in the middle of editing, and not letting 2 people edit
it at once.

[2] Syntax checking is making sure you didn't make a typo before
saving it.

[3] visudo edits /etc/sudoers, the config file for the sudo command,
which lets people DO stuff as the SuperUser.

[4] vipw edits /etc/passwd.

[5] vigr edits /etc/group.

[6] the EDITOR environment variable is also used by other stuff that
calls an external editor, like mutt, lynx, cvs, etc.

-- 
laurel at sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org



More information about the Techtalk mailing list