I don't ever use the "crontab" command on Linux.  Put the command you
want cron to execute in a small shell script, and drop the shell script
in /etc/cron.hourly, cron.daily, cron.weekly, or cron.monthly.  Look at
/etc/crontab to see when the script will be run.  If you want it to run
at some other time or interval, put a cron entry in a file (with "root"
before the command) and drop it in /etc/cron.d.  Cron checks cron.d
every minute for new files.  I much prefer this approach than loading up
root's crontab with commands.  

-----Original Message-----
From: Linux on 390 Port [mailto:[EMAIL PROTECTED] On Behalf Of
Scully, William P
Sent: Wednesday, April 05, 2006 3:13 PM
To: [email protected]
Subject: Editing crontab


Hopefully someone will have a suggestion on this.  A user reports that
when they log onto root and: 

  crontab -e

Changes made, even simply changes such as to comments, are lost after
then exit the vi editor.  The message shows:

  crontab: no changes made to crontab

Logged on as root, I can edit the file, called
/var/spool/cron/tabs/root, using vi.  These changes are (not
surprisingly) accepted.  After making a change (adding a comment),
crontab -e shows the newly-updated file.  But I still cannot change it
(for example, remove my newly-added comment) with the vi ":wq" command.
If I use crontab -e to edit the file and ":w /root/asdf" I do see my
changes in file /root/asdf.  An lsattr command on the file in
/var/spool/cron/tabs/root shows no attributes set (all hyphens).  ls
shows the file is R/W to owner alone.  Even after I restart the server,
the problem persists.  The syntax of the existing cron file appears
correct, in that "it's five tokens, plus the command to run".  Even if I
remove all records (excepts comments), the "no changes" message still
occurs.

What gives?  

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions, send
email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or
visit http://www.marist.edu/htbin/wlvindex?LINUX-390

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to