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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
09-06-2012, 04:26 PM
|
#1
|
Member
Registered: Aug 2012
Posts: 789
Rep:
|
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?
|
|
|
09-06-2012, 05:43 PM
|
#2
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,398
|
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
|
|
|
09-06-2012, 06:32 PM
|
#3
|
Member
Registered: Aug 2012
Posts: 789
Original Poster
Rep:
|
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 ~]#
|
|
|
09-06-2012, 07:07 PM
|
#4
|
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:
|
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.
|
|
|
09-06-2012, 08:44 PM
|
#5
|
Member
Registered: Aug 2012
Posts: 789
Original Poster
Rep:
|
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?
|
|
|
09-07-2012, 12:37 AM
|
#6
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,398
|
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
As vorbote has pointed out, it looks like webmin may have altered your system.
|
|
|
09-07-2012, 07:33 AM
|
#7
|
Member
Registered: Aug 2012
Posts: 789
Original Poster
Rep:
|
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]#
|
|
|
All times are GMT -5. The time now is 01:29 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|