Cron jobs in cron.daily not showing up in Webmin

Hi guys,

Jobs in /etc/cron.daily are running fine, however they don't show up in Webmin's cron section. I'm guessing Webmin just isn't scanning the cron.daily directory and therefore isn't showing jobs in there? Looks like this issue has been around for a while: https://virtualmin.com/node/21957 . Would be great to get this fixed so all current cron jobs are visible in Webmin.

Some other folders that should be included too (in case they already aren't):

cron.hourly cron.monthly cron.weekly

Cheers

Status: 
Active

Comments

Howdy -- hmm, that's a tricky question, and I'm sure Jamie will chime in on that. I understand it seems this way, but it's not actually a bug... I'll explain --

The issue there, is that technically those directories aren't specific to cron.

A "cron job" on a Linux system has either an entry in /var/spool/cron/crontabs, or, system crontabs are in /etc/crontab. Cron also controls the files in /etc/cron.d.

It's another tool, called "runparts", that executes scripts in directories such as /etc/cron.daily and cron.weekly.

Cron isn't running the scripts in those directories. Cron executes runparts at certain intervals -- and runparts runs the scripts in those directories.

So we'll see what Jamie thinks about that, but it's not just an oversight... those files aren't technically controlled by cron.

Hey andreychek, thanks for the reply and the clarification. I am seeing the entries for cron.hourly in Webmin though (/etc/cron.hourly/0anacron and /etc/cron.hourly/awstats)- is that handled differently to cron.daily / cron.weekly?

The reason I bring this up is I just installed rkhunter, which places its daily cron job in /etc/cron.daily, and was confused why it was wasn't showing up in Webmin. Especially since all the jobs in cron.hourly folder are listed. Also, I don't have webalizer enabled but noticed a cron file called /etc/cron.daily/00webalizer, so I'm guessing if I enabled it that job would be shown too.

Perhaps the difference is these jobs were created by Webmin? If so, it would be awesome if Webmin could automatically show all the files in those folders. I reckon the Cron page would be more useful if it was a true representation of everything cron was doing on the host. Just my 2 cents anyway :)

Hmm, yeah we may just need Jamie's input there, he'd have a better idea of how that's all supposed to function. He'll chime in here shortly!

Is there a separate cron job that runs runparts and refers to the cron.daily directory? If so, what's the full command of that job?

I found this: https://linux.die.net/man/5/anacrontab

From what I read, it looks like jobs in the cron.hourly/daily/weekly/monthly folders are controlled by anacron. Anacron's jobs are in /etc/anacrontab

That's pretty much all I could find unfortunately

Jamie, it looks like CentOS 7 uses run-parts within Anacron, with the following syntax:

1       5       cron.daily              nice run-parts /etc/cron.daily
7       25      cron.weekly             nice run-parts /etc/cron.weekly
@monthly 45     cron.monthly            nice run-parts /etc/cron.monthly

That's pretty similar to how Ubuntu does it as well, though Ubuntu doesn't use Anacron.

Hmm, that may be tough to support - Webmin knows about run-parts when it's run via regular Cron, but not when it's run via Anacron.