[Techtalk] crontab vs vi

Akkana akkana at shallowsky.com
Sat Jan 12 12:03:19 EST 2002

Carol writes:
> If you didn't use this, but edited straight from vi and the processes work 
> correctly, I wonder how? That would be something worth pursuing!

Works for me too (on a Redhat 7.1 system).  On Redhat (I think SuSE
is very similar), cron runs a script that checks the directories
/etc/cron.daily (hourly, weekly, monthly) at appropriate intervals,
and executes any script that shows up in those directories.
I've edited files in /etc/cron.daily, and had the changes show
up in the run the next morning; and I've installed new scripts
there, and they ran the next morning.

I assume I would probably have to run crontab -e (or similar) if
I wanted to change the script that checks these directories, or if
I wanted to add a script that would run at exactly 3pm on Tuesdays
-- but if I don't need more granularity than "daily, hourly, weekly,
monthly" and don't care that much exactly when my script runs, I
can use vi to edit the files in those directories.  

The advantage of using the directories is that I don't have to spend
ten minutes in the cron man pages reminding myself of the syntax
for cron's time specifier; just write a script that works and put
it in the right place.

The directories aren't a standard Unix-ism, though, so someone who
sysadmin'ed on a system that didn't have that setup might have strong
feelings that one should use crontab.  Irix didn't have anything similar,
and there I had to make a cron script and run crontab to install it.


More information about the Techtalk mailing list