Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cronie appears to run spontaneously #110

Closed
mauricev opened this issue Apr 7, 2022 · 7 comments
Closed

cronie appears to run spontaneously #110

mauricev opened this issue Apr 7, 2022 · 7 comments
Labels

Comments

@mauricev
Copy link

mauricev commented Apr 7, 2022

I’ve been noticed duplicates of files after cronie runs in the middle of the night. So I made a test and sure enough, cronie runs in response to my crontab and it runs a second time, on its own executing the programs in /etc/cron.daily. When I deleted my crontab, it still ran what was in cron.daily. What’s triggering it to run on its own apparently?

@t8m
Copy link
Member

t8m commented Apr 7, 2022

What do you mean by "my crontab"? There are various crontabs that are parsed and handled by cronie.
Please see the manual page crond(8).

@t8m t8m added the question label Apr 7, 2022
@mauricev
Copy link
Author

mauricev commented Apr 7, 2022

/etc/crontab is the sole crontab on my system to my knowledge. Are you suggesting there is a hidden crontab somewhere?

@t8m
Copy link
Member

t8m commented Apr 7, 2022

There is nothing in /etc/cron.d/ ?

@mauricev
Copy link
Author

mauricev commented Apr 7, 2022

Interestingly, there is, a file named 0hourly. Its content is

# Run the hourly jobs
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
01 * * * * root run-parts /etc/cron.hourly

Which I assume means it will trigger the scripts in /etc/cron.hourly. However, the scripts in there aren’t the ones being duplicated. They’re in /etc/cron.daily.

Here is a system showing when they're running

I ran at 2022.04.02-03.13.36
I ran at 2022.04.02-03.53.32
I ran at 2022.04.03-03.14.04
I ran at 2022.04.03-03.20.38
I ran at 2022.04.04-03.13.32
I ran at 2022.04.04-03.33.33
I ran at 2022.04.05-03.15.29
I ran at 2022.04.05-03.15.29
I ran at 2022.04.06-03.13.24
I ran at 2022.04.06-03.25.04
I ran at 2022.04.07-03.13.32
I ran at 2022.04.07-03.44.11

@mauricev
Copy link
Author

mauricev commented Apr 7, 2022

Here’s a system with no /etc/crontab file

I ran at 2022.04.02-04.31.42
I ran at 2022.04.03-04.26.58
I ran at 2022.04.04-04.20.39
I ran at 2022.04.05-03.56.57
I ran at 2022.04.06-04.41.52
I ran at 2022.04.07-03.56.42

@t8m
Copy link
Member

t8m commented Apr 7, 2022

If you look into cron.hourly, you'll see something more there.
Most probably anacron is being run there and then anacron executes things from crond.daily.

@mauricev
Copy link
Author

mauricev commented Apr 7, 2022

A-ha! Anacron is indeed there and the /etc/anacrontab does indeed run all the cron scripts. Thank you for figuring that out!

@t8m t8m closed this as completed Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants