You are not logged in.

#1 2015-02-12 18:08:51

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 341

[SOLVED} Does cronie pay attention to /etc/crontab or not?

The cron wiki page is unclear on this point, there is no cronie man page, and the cron man page is hopelessly out of date (and incorrect).

This post suggests that cronie is compiled to ignore /etc/crontab.

Can anyone confirm this, and if so, what is the prescribed way to set up system cron jobs which are run exactly once a day, but only if the machine is turned on during that time?  Using crontab -e as root creates a root crontab file in /var/spool/cron -- I'm not sure I like the idea of putting system cron jobs in root's crontab file -- I've always considered this to be the place for user, not system, crontab files.

I plan on updating the Wiki, as this is all terribly confusing for someone who has been using vixie-cron for their entire adult linux life.

Has everyone basically switched to using systemd/Timers?  It's the only reason I can think of that the wiki documentation appears to be so vague.

Last edited by pgoetz (2015-02-13 14:14:58)

Offline

#2 2015-02-12 19:42:13

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [SOLVED} Does cronie pay attention to /etc/crontab or not?

I believe you should put your entries as files in /etc/cron.d


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2015-02-12 22:04:49

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 341

Re: [SOLVED} Does cronie pay attention to /etc/crontab or not?

Thanks, progandy.  I've updated the cron wiki page accordingly.

Offline

#4 2015-02-13 01:54:43

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [SOLVED} Does cronie pay attention to /etc/crontab or not?

There is also man crond. However, the date is the same.

There is a very easy way to check what is used and that is to add a job which touches a file somewhere to the file you are unsure of. This confirms that crontab is still read, as the manual pages say. Just that by default it is empty.

EDIT: I've corrected the wiki. I take it that the files added to /etc/cron.d are run automatically. I think I have an old crontab designed to run them. But though this is unnecessary, crontab definitely still works.

Last edited by cfr (2015-02-13 02:07:12)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2015-02-13 10:35:58

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 341

Re: [SOLVED} Does cronie pay attention to /etc/crontab or not?

Thanks, cfr; it seems you are correct.  I was going by the forum post (https://bbs.archlinux.org/viewtopic.php?id=158159) I referenced previously.  The lack of documentation on this is fairly frustrating.

One point of clarification regarding your update of the wiki page:  The /etc/crontab file is not created by default, as far as I can tell --  there is no such file on any Arch system I've set up so far except in the single case where I created the file.  This is one of the reasons I thought /etc/crontab is ignored by cronie.  This needs to be updated in the Wiki.  We can change it back if for some reason I am incorrect about this, but I don't see how that can be.

Last edited by pgoetz (2015-02-13 10:52:17)

Offline

#6 2015-02-13 12:39:24

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [SOLVED} Does cronie pay attention to /etc/crontab or not?

Yes, I think you are right. I have comments in mine to the effect that it is based on Debian's file, so I don't think it exists on Arch by default. It just works if you create it. (In contrast, /etc/anacrontab is created by default.)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#7 2015-02-13 14:14:31

pgoetz
Member
From: Austin, Texas
Registered: 2014-02-21
Posts: 341

Re: [SOLVED} Does cronie pay attention to /etc/crontab or not?

I'm going to mark this ticket as resolved.  Thanks to cfr and progandy for helpful comments resolving this issue.

The Wiki page has been updated to provide more useable information to others with similar frustrations.  Really, this is another Wiki page in need of a complete rewrite, but at least all  the essential stuff is now there.

Offline

Board footer

Powered by FluxBB