crontab void of entries

General support questions
Post Reply
northpoint
Posts: 107
Joined: 2016/05/23 11:57:12

crontab void of entries

Post by northpoint » 2018/02/21 20:56:09

I have been working on a script to run nightly and just noticed something:

My /etc/crontab file is basically empty of the hourly, daily, monthly ect... entries on a server I administer via remote. So, I booted up my VM of centos7 locally and checked the crontab there. Same thing. Here is the crontab file entries I have:

Code: Select all

[coffee@centos etc]$ cat crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name  command to be executed
Normally on other flavors of linux and also in the docs for centos I see this:

Code: Select all

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
Should I be adding those in? I would think those would be default when installing centos 7.
Ryzen x1800 * Asus x370 Pro * CentOS 7.4 64bit / Icewarp /

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: crontab void of entries

Post by TrevorH » 2018/02/21 22:21:17

Check /etc/anacrontab instead.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
avij
Retired Moderator
Posts: 3046
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland
Contact:

Re: crontab void of entries

Post by avij » 2018/02/21 22:22:22

The configuration you are looking for resides in /etc/anacrontab. No, you don't need to change your /etc/crontab, the emptiness is intentional.

northpoint
Posts: 107
Joined: 2016/05/23 11:57:12

Re: crontab void of entries

Post by northpoint » 2018/02/21 22:49:37

Thanks very much!

I did look at the centos docs page but they didnt have centos7 and it went as far as ver 5. Googled this also but everything just talks about editing the /etc/crontab file. So, Perhaps I should have dug in deeper on the release notes for 7 or at the wiki. :)

Anyways, I want to thank you both for replying. Have a great day/night.

Northpoint
Ryzen x1800 * Asus x370 Pro * CentOS 7.4 64bit / Icewarp /

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: crontab void of entries

Post by TrevorH » 2018/02/21 22:56:25

Because CentOS is a clone of RHEL, docs for versions 5+ can be found by looking at docs.redhat.com
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply