System crontab

keith smith klsmith2020 at yahoo.com
Sat Jul 31 14:51:21 MST 2010


Thanks!

------------------------

Keith Smith

--- On Fri, 7/30/10, Lisa Kachold <lisakachold at obnosis.com> wrote:

From: Lisa Kachold <lisakachold at obnosis.com>
Subject: Re: System crontab
To: "Main PLUG discussion list" <plug-discuss at lists.plug.phoenix.az.us>
Date: Friday, July 30, 2010, 5:20 AM

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.

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

-- 
IvedaXpress.com Systems Engineer
Office: (480)307-8712
AT&T: (503)754-4452 


"Faith is, at one and the same time, absolutely necessary and altogether impossible.
"
--Stanislav Lem















-----Inline Attachment Follows-----

---------------------------------------------------
PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20100731/f8ed3660/attachment.html>


More information about the PLUG-discuss mailing list