/etc/cron.<interval> problems

I am setting up some cron jobs, but I am getting confused. There are some directories /etc/cron.hourly, daily, monthly I dump my scripts in but they don’t get run. /etc/crontab is empty, but should have some entries for /usr/lib/cron/run-crons in there, but they are not. Actually, crons and run-crons don’t exist on my system, so there doesn’t seem anything present to actually process these cron directories and all of them are empty.

It doesn’t follow the documentation on the opensuse wiki and I am confused. Am i missing a package? Cron is from the cronie package, so it is not like I am running the old crontab software that was phased out a few year ago.

What am I missing? Is this not used anymore and the directories as just leftovers and the docs aren’t updated yet?

Look into systemd timers.

That’s a lot of complexity for just kicking off a simple script every hour… Now I have to manager 1) the script, 2) a service file and 3) a timer file. Instead of just managing a single script and dumping or linking it to a directory and be done with it. Sometimes simple is better.

Probably package providing cron itself.

Dont think so:

❯ zypper se -i cron
Loading repository data...
Reading installed packages...

S  | Name   | Summary                     | Type
---+--------+-----------------------------+--------
i  | cron   | Auxiliary package           | package
i  | cronie | Cron Daemon                 | package
i+ | kcron  | Cron job configuration tool | package

And cron.service is enabled and active?

❯ systemctl status cron
● cron.service - Command Scheduler
     Loaded: loaded (/usr/lib/systemd/system/cron.service; enabled; preset: enabled)
     Active: active (running) since Fri 2025-10-10 10:15:03 CEST; 44min ago
 Invocation: d8810d85f62147d58a1f6309a87584fc
   Main PID: 1764 (cron)
      Tasks: 1
        CPU: 25ms
     CGroup: /system.slice/cron.service
             └─1764 /usr/sbin/cron -n

In fact I agree :wink:

My cronjobs (not in the the system crontab nor in the ‘hourly’, etc. files, but in roots crontab) are still functioning (I am on Leap 15.6). I assume that,seeing the enormous base of existing crontab runs in the world, systemd will support crontab by emulation for a long time.

But it could be that you need to install some “deprecated” package to get things going like @arvidjaar suggests. Just search through the OSS packages with “cron”.

/usr/lib/cron does not exist, which is where the scripts to run the cron.<interval> are supposed to be located. Perhaps its deprecated in favor a moreflexible but complex solution in systemd timers

I see this developed already while I was typing.

Just create it and see if it works?

 boven:~ # ls -la /usr/lib/cron
total 36
drwxr-xr-x   2 root root  4096 May  9  2023 .
drwxr-xr-x 110 root root 20480 Oct  7 09:07 ..
-rwxr-xr-x   1 root root  9412 Jan 18  2023 run-crons
boven:~ # 

By the time I have reverse engineered the old cron functionality, it’d be quicker just to create the systemd timer. :upside_down_face:

OK, it seems installing the package cronie-anacron will actually do this. Not as per documentation on the wiki, but it creates a seperate service and config file /etc/anacron that does the runparts thing, seperate from the regular crontab

I think I’ll just move to systemd and use what is available than to keep installing stuff and wondering later if I have or want to reinstall why certain parts don’t work no more.

You really need to learn some basic tools like rpm -l.

cronie installs it in /usr/libexec/cron/run-crons. But crond does not use it by default anyway.

That is your actual problem. Just reinstall cronie (and possibly check for any /etc/crontab.rpm* files).

For reference:

andrei@tumbleweed:~> sudo cat /etc/crontab
SHELL=/bin/sh
PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin
MAILTO=root
#
# check scripts in cron.hourly, cron.daily, cron.weekly, and cron.monthly

# 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
@hourly         root      run-parts /etc/cron.hourly
@daily          root      run-parts /etc/cron.daily
@weekly         root      run-parts /etc/cron.weekly
@monthly        root      run-parts /etc/cron.monthly

andrei@tumbleweed:~>

No mention of run-crons.

Seriously, I was going by documentation on the official opensuse wiki, which explicitly states opensuse uses run-crons vs run-parts like Fedora for reasons. It also states the location. Yeah, I know using Google before asking a question.

Didn’t think I’d also have to query rpm contents to verify supplied documentation first. :slight_smile:

openSUSE wiki is not “supplied documentation”. It is maintained by volunteers. Do you volunteer to improve openSUSE wiki about cron?

“Supplied documentation” is man pages which do not even mention run-crons let alone its location.

The wiki is slightly dated. But comparing the content of the cron/cronie file list with the wiki sheds some light.

The wiki refers to the old path /usr/lib/cron/run-crons but cronie now uses /usr/libexec/cron/run-crons. Actual users of cron could update the wiki to the actual paths.
The above is only an example.

No offense Andrei, and you can try to gaslight all you want but fact of the matter is the wiki is on the opensuse domain, endorned with the official logos, with a copyright notice of SuSE LLC (as well as contributors). For all intends and purposes, users looking for information specific to OpenSUSE, see it as official documentation. Whether or not it is maintained by employees or volunteers is irrelevant.

And yes, I’d be more than happy to help out if I have all the correct information (which I don’t at this point, too many inconsistencies) as it is an amazing source of information for opensuse users and in many ways a rival for the arch wiki.