System crontab

Kevin Faulkner kondor6c at encryptedforest.net
Fri Jul 30 19:01:11 MST 2010


On Friday 30 July 2010 05:20:32 Lisa Kachold wrote:
> Hi Keith:
> 
> On Thu, Jul 29, 2010 at 10:11 PM, keith smith <klsmith2020 at yahoo.com> wrote:
> > Hi,
> > 
> > I have been setting up a cron job and found out there are two different
> > crons. 1) the user cron located at  /var/spool/cron/ on my Fedora Box and
> > 2) the system crontab located at /etc/crontab .
> > 
> > When I do the crontab -e (if I am recalling correctly) I am editing the
> > user crontab.
> > 
> > To edit the system crontab do I just use VI or some other editor?
> > 
> > I would have thought if I were root and issued crontab -e I would have
> > been editing the system crontab, however this was not my experience.
> > 
> > Thanks in advance for your insight.
> > 
> > 
> > ------------------------
> > Keith Smith
> 
> Crontab can be configured in /etc/crontab with  joe, vim, emacs or pico.

Yes, the system just uses the environment variable "EDITOR".

> 
> You can setup your default editor in bash as well to trivially use the
> /var/spool/cron/root file:
> 
> *add to .bashrc*
> 
> #!/bin/bash
> # F. Bar
> # SomeCompany or dot.com
> # $HOME/.bashrc
> # Add various additional things that don't go into /etc/profile
> 
> # Date which can be trivially used for file copy or other tasks
> # example: copy file.ext file.ext.$today
> 
> today=date +"%m-%d-%Y"
> 
> # Setup my default editor for crontab and other things (visudo)
> 
> export EDITOR=nano
> export VISUAL=nano
> 
> #  Create a bash alias for crontab to use nano
> 
> alias crontab='env EDITOR=nano crontab -e'
> 
> # System management aliasesssssss
> alias log='tail -n 200 /var/log/messages |less'
> alias mailmelog='tail -n 500 /var/log/messages |mail -s "Message Log"
> foobar at somecompany.com
> 
> # end custom .bashrc
> 
> 
> Or from the command line:
> 
> sudo env EDITOR=nano crontab -e
> 
> 
> Of course you can easily use the /etc/crontab also with
> 
> sudo nano /etc/crontab
> 
> 
> 
> crontab has a great deal of fun applications to maintain your system, run
> daily alerts and provide ease for running backup scripts.  Anything that
> you call from the command line can go into crontab.
> 
> Be sure to also check anacron for your daily scheduled jobs.  Anacron is
> often a hiding place for crackers to place their reverse shell scripts and
> other mayhem.
> 
> http://www.ouah.org/corezine1_back.txt
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=510828


More information about the PLUG-discuss mailing list