LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Where are cron jobs located when not under /var/spool/cron/root? (http://www.linuxquestions.org/questions/linux-newbie-8/where-are-cron-jobs-located-when-not-under-var-spool-cron-root-4175426026/)

NotionCommotion 09-06-2012 04:26 PM

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?

chrism01 09-06-2012 05:43 PM

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


NotionCommotion 09-06-2012 06:32 PM

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 ~]#


vorbote 09-06-2012 07:07 PM

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.

NotionCommotion 09-06-2012 08:44 PM

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?

chrism01 09-07-2012 12:37 AM

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.

NotionCommotion 09-07-2012 07:33 AM

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 12:25 PM.