LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-06-2012, 04:26 PM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Rep: Reputation: Disabled
Where are cron jobs located when not under /var/spool/cron/root?


New to CRONTAB. I am running Centos 5.8 with Webmin.

Under Webmin, I go to the System/Scheduled Cron Jobs tab, and there are several CRON jobs for user root.

I then look at /var/spool/cron, and it was empty.

I then typed "crontab -e", and a new file /var/spool/cron/root was created. I go back to Webmin, and it was added. I then add a new cron using Webmin, and it updates /var/spool/cron/root.

Where are those cron jobs listed under Webmin which are not included under /var/spool/cron/root?
 
Old 09-06-2012, 05:43 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,398

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
There are 2 locations;

1. personal crontabs (inc root) go in /var/spool/cron
2. system crontabs / crontab dirs in /etc
Code:
-rw-r--r--.  1 root root    541 Jul 19  2011 anacrontab
drwxr-xr-x.  2 root root   4096 Aug 16 23:21 cron.d
drwxr-xr-x.  2 root root   4096 Aug 16 23:22 cron.daily
-rw-r--r--.  1 root root      0 Jul 19  2011 cron.deny
drwxr-xr-x.  2 root root   4096 Aug 16 23:22 cron.hourly
drwxr-xr-x.  2 root root   4096 Aug 16 23:22 cron.monthly
-rw-r--r--.  1 root root    457 Sep 27  2011 crontab
drwxr-xr-x.  2 root root   4096 Sep 27  2011 cron.weekly
 
Old 09-06-2012, 06:32 PM   #3
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
Thanks chrism01, Where would system crons be located?


Code:
[root@localhost ~]# find / -name *cron -type d
/var/spool/anacron
/var/spool/cron
/usr/libexec/webmin/cluster-cron
/usr/libexec/webmin/webmincron
/usr/libexec/webmin/cron
/usr/libexec/webmin/blue-theme/cluster-cron
/usr/libexec/webmin/blue-theme/cron
/usr/libexec/webmin/mscstyle3/cron
/usr/libexec/webmin/caldera/cron
/usr/share/logwatch/scripts/logfiles/cron
/etc/webmin/cluster-cron
/etc/webmin/webmincron
/etc/webmin/cron
[root@localhost ~]#
 
Old 09-06-2012, 07:07 PM   #4
vorbote
Member
 
Registered: Aug 2009
Location: 2,625 m of paranoia above sea level
Distribution: Arch Linux, Debian GNU/Linux, Fedora, Void Linux, FreeBSD, OpenBSD and Win10
Posts: 77

Rep: Reputation: Disabled
If webmin hasn't diced and sliced your configuration files yet---but be sure it will someday, learn to use a console text editor to configure your system instead---, system cronjobs are stored in /etc/cron.{hourly,daily,weekly,monthly} and anacron jobs in /etc/cron.d if using Vixie cron or its fork cronie; there is sometimes an /etc/crontab file that usually drives up anacron and major system-wide cron jobs. Other cron applications use slightly different schemes but the names are similar even if syntax may not.

Last edited by vorbote; 09-06-2012 at 07:10 PM. Reason: More details.
 
Old 09-06-2012, 08:44 PM   #5
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
Quote:
If webmin hasn't diced and sliced your configuration files yet
YIKES!

Quote:
system cronjobs are stored in /etc/cron
Why don't I have any?
 
Old 09-07-2012, 12:37 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,398

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
They are (normally) where I showed you; what's not clear ?
(As confirmed by vorbote)
Note that some are dirs, some are files; you're only searching dirs there..
Tell us what distro+version you have
Code:
cat /etc/*release*
As vorbote has pointed out, it looks like webmin may have altered your system.
 
Old 09-07-2012, 07:33 AM   #7
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
Thanks chrism01,

Silly mistake on my part.

I do have a /etc/crontab as you indicated. Then in each of those directories, I have the appropriate scripts which are run.

I am all good now.



Code:
[root@localhost etc]# cat crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
[root@localhost etc]#
 
  


Reply

Tags
cron


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Cron directories: /var/spool/cron/cron.GfqqGO Woodsman Slackware 4 05-11-2011 02:37 PM
/etc/crontab vs /etc/cron.d vs /var/spool/cron/crontabs/ drManhattan Linux - Newbie 9 01-04-2011 01:12 AM
cron hourly, daily, cron.d jobs don't execute eggsmartha Linux - General 3 09-17-2007 06:37 PM
execute root cron jobs props666999 Debian 1 09-07-2007 12:40 PM
Failed to lock file /var/spool/cron/root after 5 minutes teeno Linux - Software 0 09-24-2003 02:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration