Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
what to do about crons?
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  

do you cron?
anacron (2009)
0%
 0%  [ 0 ]
bcron (2015)
0%
 0%  [ 0 ]
cronie (2019)
35%
 35%  [ 18 ]
dcron (2011)
7%
 7%  [ 4 ]
fcron (2016)
11%
 11%  [ 6 ]
vixie-cron (2004)
39%
 39%  [ 20 ]
systemd
1%
 1%  [ 1 ]
no i don't
3%
 3%  [ 2 ]
Total Votes : 51

Author Message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3376

PostPosted: Thu Apr 04, 2019 2:11 pm    Post subject: Reply with quote

I tend to prefer "live" packages, because I know that someone is taking care of them. The idea of a "done" package sounds good, but I also am not sure that anything can ever be "done", even if it is feature complete, because the environment is always changing, and it's always possible to find a long-lurking bug.

But the other reason to move to cronie is because the reduced writes would make it more SSD-friendly.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 2889
Location: Illinois, USA

PostPosted: Thu Apr 04, 2019 3:57 pm    Post subject: Reply with quote

depontius wrote:
I'm using vixie-cron, just because that's how I originally set things up, and it's been OK. Reading this thread, it looks as vixie-cron may not be very "alive", and I've also heard that cronie avoids writing to disk, which is better for SSDs. Switching has been moving toward a planned item for a few weeks. Hearing that it's a simple matter of switching packages, and that it will just use my existing cron files helps push that.


I also had to unmerge anacron. The USE flag on cronie enables a built in anacron. etc-update results indicate that the periodic test runs are eliminated. That's a good thing. Otherwise, logs indicate it's working.

I did notice that it created /lib/systemd and put systemd crap in it. Some surgery on the ebuilds and moving them to local took care of that. Straight forward. IMHO, the ebuild should have a systemd flag and install either the openrc files or the systemd files, not both.
my root crontab:
Code:
gentoo ~ # crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.XXXXIVrxAM installed on Sun Feb  3 08:03:41 2019)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
0  0 * * *    /usr/local/sbin/nightly_logrotation
#10 3 * * *    /usr/local/sbin/nightly_sync
#24 3 * * sun  /usr/local/bin/grabit &> /var/log/grabit
0  1 * * *    updatedb  2>&1 >/dev/null
15 2 * * tue  /sbin/fstrim -va  | logger
0 0,6,12,18 * * *    /usr/sbin/ntpdate pool.ntp.org|logger
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 3699
Location: Dallas area

PostPosted: Thu Apr 04, 2019 4:21 pm    Post subject: Reply with quote

Tony0945 wrote:
I did notice that it created /lib/systemd and put systemd crap in it. Some surgery on the ebuilds


Code:
grep systemd /etc/portage/make.conf
INSTALL_MASK="/lib/systemd /usr/lib/systemd/"

should keep stuff from being installed in those directories without needing to change ebuild.
_________________
Asus m5a99fx, FX 8320 - nouveau & radeon, oss4
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
4.14.62 kernel, profile 17.0 (no-pie) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 2889
Location: Illinois, USA

PostPosted: Thu Apr 04, 2019 4:44 pm    Post subject: Reply with quote

Code:
tony@MSI ~ $ grep systemd /etc/portage/make.conf
INSTALL_MASK="${INSTALL_MASK} /etc/systemd /lib/systemd /usr/lib/systemd /usr/lib/modules-load.d"
tony@MSI ~ $ ssh root@gentoo
Password:
gentoo ~ # grep systemd /etc/portage/make.conf
INSTALL_MASK="${INSTALL_MASK} /usr/lib/systemd /etc/systemd"
USE=" -acl -accessibility  -dbus -bluetooth -guile -libav -introspection -ldap -nls -python -perl -systemd \

Needed an update on my stable server. Thanks, Anon-A-moose. I had forgotten that. I better check all my systems.
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1380

PostPosted: Thu Apr 04, 2019 9:21 pm    Post subject: Reply with quote

krinn wrote:
the problem with "stall" package is that it could be an effect of stability. why touching code of something that do the job?
i'm not to push something out just because it is stall ; if no glsa, and i fail to see when vixie-cron has crash on my computer (but to be honest, i'm not looking specially if it has crash), i'm happy with it.
Exactly. There seems to be a trend in the open source community to assume code always needs to be stirred to be any good. Sometimes "not maintained" actually means "just plain works". The common notion that all gtk2 needs to be globally replaced with gtk3 comes to mind.
Fitzcarraldo wrote:
The three Linux machines were originally using the cronie, cron, and vixie-cron daemons, respectively. However, I found that the text file on the machine running vixie-cron was always truncated. It appeared that somehow vixie-cron was not waiting for the Buku print command in the cron job to finish. So I stopped and disabled the vixie-cron daemon on that machine, uninstalled vixie-cron, installed cronie, enabled and started the cronie service, and everything now works fine. So I now avoid using vixie-cron in any installations.
This caught my eye as that seems to be very surprising behavior for anything, let alone something as basic as a cron process. Was that Buku process performed from within a shell script? I'm surprised that even the shell would allow that. This sounds a bit like something somewhere in the Buku logic that's possibly closing something that's buffering network data, without flushing it first. I actually ran into something similar using CURL calls to download a request to a file. If I closed the file handle after the curl request completed without flushing the file handle, it could truncate the file because of buffering...though it didn't always do it. It's possible that the behavior you saw there may have even been a race condition where cronie just happened to take slightly longer, accidentally causing it to work...at least it's a possibility.

I've just simply been using vixie-cron since installing this machine 14 years ago and it's always just worked.

Tom
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1635
Location: United Kingdom

PostPosted: Fri Apr 05, 2019 2:58 pm    Post subject: Reply with quote

tld wrote:
Fitzcarraldo wrote:
The three Linux machines were originally using the cronie, cron, and vixie-cron daemons, respectively. However, I found that the text file on the machine running vixie-cron was always truncated. It appeared that somehow vixie-cron was not waiting for the Buku print command in the cron job to finish. So I stopped and disabled the vixie-cron daemon on that machine, uninstalled vixie-cron, installed cronie, enabled and started the cronie service, and everything now works fine. So I now avoid using vixie-cron in any installations.
This caught my eye as that seems to be very surprising behavior for anything, let alone something as basic as a cron process. Was that Buku process performed from within a shell script? I'm surprised that even the shell would allow that. This sounds a bit like something somewhere in the Buku logic that's possibly closing something that's buffering network data, without flushing it first. I actually ran into something similar using CURL calls to download a request to a file. If I closed the file handle after the curl request completed without flushing the file handle, it could truncate the file because of buffering...though it didn't always do it. It's possible that the behavior you saw there may have even been a race condition where cronie just happened to take slightly longer, accidentally causing it to work...at least it's a possibility.

Code:
11,31,51 * * * * rm /home/fitzcarraldo/ownCloud/Bookmarks/*.txt; sleep 30s && /usr/bin/buku -p --nc > /home/fitzcarraldo/ownCloud/Bookmarks/Buku_bookmarks_backup.txt

tld, the above-mentioned text file was always (consistently) truncated when that machine used vixie-cron with the above cron job. After from switching from vixie-cron to cronie (and doing absolutely nothing else), the text file is never truncated with the same cron job. That's good enough for me.
_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
mike155
Veteran
Veteran


Joined: 17 Sep 2010
Posts: 1001
Location: Frankfurt, Germany

PostPosted: Fri Apr 05, 2019 4:38 pm    Post subject: Reply with quote

Fitzcarraldo wrote:
11,31,51 * * * * rm /home/fitzcarraldo/ownCloud/Bookmarks/*.txt; sleep 30s && /usr/bin/buku -p --nc > /home/fitzcarraldo/ownCloud/Bookmarks/Buku_bookmarks_backup.txt

It is well known that environment variables in a job executed by vixie cron differ from environment variables after a user login. For that reason, you have to set required environment variables yourself before executing any program in a vixie cron context.

Let me guess what happened when the statement shown above was executed by vixie-cron:
  1. buku didn't work as expected because of missing environment variables
  2. buku printed an error message to stderr, which you didn't see or ignored
  3. After printing the error message, buku terminated - and the output file was empty (truncated)
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1635
Location: United Kingdom

PostPosted: Fri Apr 05, 2019 5:18 pm    Post subject: Reply with quote

mike155, you guessed wrong; the text file was truncated about half-way through the circa 1700 bookmark entries.

Gentoo Wiki wrote:
cronie

Cronie (sys-process/cronie) is a fork of vixie-cron done by Fedora. Because of it being a fork it has the same feature set the original vixie-cron provides. Additionally cronie comes with an anacron implementation which must be enabled through the anacron USE flag.

_________________
Clevo W230SS: amd64 OpenRC elogind nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 OpenRC elogind xf86-video-ati. Dual boot Win 7 Pro 64-bit.
KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 2889
Location: Illinois, USA

PostPosted: Sat Apr 06, 2019 12:42 am    Post subject: Reply with quote

Quote:
fork of vixie-cron done by Fedora

I'll have to do a meld on the sources make sure their isn't a trojan horse.
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 3699
Location: Dallas area

PostPosted: Sat Apr 06, 2019 11:02 am    Post subject: Reply with quote

BTW, to get rid of the "test" stuff from vixie-cron just modify /etc/crontab and comment out the "test" line.
It just basically runs looking for left over lockfiles and deletes them.

I've moved over to cronie, myself. But I noticed the above when looking at it.
_________________
Asus m5a99fx, FX 8320 - nouveau & radeon, oss4
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
4.14.62 kernel, profile 17.0 (no-pie) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
CasperVector
Tux's lil' helper
Tux's lil' helper


Joined: 03 Apr 2012
Posts: 107

PostPosted: Sun Apr 07, 2019 3:12 am    Post subject: Reply with quote

busybox cron on Alpine, dcron on Void; I no longer use Gentoo, but I still find f.g.o quite helpful.
_________________
My current OpenPGP key:
RSA4096/0x227E8CAAB7AA186C (expires: 2020.10.19)
7077 7781 B859 5166 AE07 0286 227E 8CAA B7AA 186C
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 2889
Location: Illinois, USA

PostPosted: Sun Apr 07, 2019 12:56 pm    Post subject: Reply with quote

Anon-E-moose wrote:
It just basically runs looking for left over lockfiles and deletes them.

Wouldn't mind that if it din't fill the log with trash.
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 2889
Location: Illinois, USA

PostPosted: Sun Apr 07, 2019 3:50 pm    Post subject: Reply with quote

Tony0945 wrote:
Quote:
fork of vixie-cron done by Fedora

I'll have to do a meld on the sources make sure their isn't a trojan horse.

Ok, I've reviewed the sources and it's mostly a rewrite. Some things are done differently and perhaps better. The kernel interface has changed in the last nine years as has the C compiler.
The code has been put in "standard" autotools format. I'm a curmudgeon and prefer the original code layout, but that's just aesthetics. Autotools layout makes for easier ebuilds.
The only systemd stuff is the unit files and man pages. It hasn't been subsumed into systemd --- yet!

Not a whole lot of reason to switch unless there is a problem like Fitzcarraldo's. I do like anacron integration via USE flag.
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1380

PostPosted: Sun Apr 07, 2019 8:01 pm    Post subject: Reply with quote

Tony0945 wrote:
Not a whole lot of reason to switch unless there is a problem like Fitzcarraldo's. I do like anacron integration via USE flag.
Up until now my only experience with cronie has been with CentOS 6. By default that installs cronie-anacron. God only knows why that would be the default on a server OS...so step one was always to uninstall that and install crone-noanacron if I recall.

I was also a little confused as to it's default configuration. By default there's essentially nothing in crontab, and most everything seems to be based on the files in /etc/cron.d...though I imagine it could be configured either way. For example cron.d contains a file dailyjobs that runs everything in cron.daily/weekly/monthly. Is the configuration for cronie with the anacron USE off basically the same as vixie-cron?

Thanks!
Tom
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 3699
Location: Dallas area

PostPosted: Sun Apr 07, 2019 9:07 pm    Post subject: Reply with quote

I kept the anacron flag (never know when I might decide to use it)

The difference (other than producing an anacron binary - 35k on my system) are the files it puts in /etc/cron.d and a file in /etc/cron.hourly (anacron flag)

anacron + /etc/anacrontab + /etc/cron.d/0hourly + /etc/cron.hourly/0anacron = running the anacron way

/etc/cron.d/dailyjobs + no /etc/cron.d/0hourly and /etc/cron.hourly/0anacron = vixie way

Either way, any user crontab including root runs just as it would under vixie and all daily/weekly/monthly jobs should run.

On my system, root was setup to run logrotate, man-db and mlocate so I hadn't been using the ones under cron.daily.
So when I changed over there was no difference other than not having a cron log full of "test" messages.
I simply removed cron.d/0hourly and cron.hourly/0anacron, that way if I want to use anacron it's there, otherwise without the files it never runs.
_________________
Asus m5a99fx, FX 8320 - nouveau & radeon, oss4
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
4.14.62 kernel, profile 17.0 (no-pie) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 2889
Location: Illinois, USA

PostPosted: Sun Apr 07, 2019 9:39 pm    Post subject: Reply with quote

Clarifying what Anon-A-moose said, my root crontab (my only crontab) was unchanged and is still working.
Code:
~ # crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.XXXXwLntNv installed on Sat Jan  5 21:48:33 2019)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
0  0 * * *    /usr/local/sbin/nightly_logrotation 2>&1 >/dev/null |logger
0  1 * * *    updatedb   2>&1 >/dev/null |logger
15 2 * * tue  /sbin/fstrim -va  | logger
0 1,12 * * *    /usr/sbin/ntpdate pool.ntp.org|logger
Back to top
View user's profile Send private message
Maitreya
Guru
Guru


Joined: 11 Jan 2006
Posts: 407

PostPosted: Mon Apr 08, 2019 9:15 am    Post subject: Reply with quote

tld wrote:
Tony0945 wrote:
Not a whole lot of reason to switch unless there is a problem like Fitzcarraldo's. I do like anacron integration via USE flag.
Up until now my only experience with cronie has been with CentOS 6. By default that installs cronie-anacron. God only knows why that would be the default on a server OS...so step one was always to uninstall that and install crone-noanacron if I recall.

I was also a little confused as to it's default configuration. By default there's essentially nothing in crontab, and most everything seems to be based on the files in /etc/cron.d...though I imagine it could be configured either way. For example cron.d contains a file dailyjobs that runs everything in cron.daily/weekly/monthly. Is the configuration for cronie with the anacron USE off basically the same as vixie-cron?

Thanks!
Tom


I don't get the whole "God only knows why that would be the default on a server OS" remark.
Could you elaborate, because I try, but are unable to see why this is Bad?
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1380

PostPosted: Mon Apr 08, 2019 2:21 pm    Post subject: Reply with quote

Maitreya wrote:
I don't get the whole "God only knows why that would be the default on a server OS" remark.
Could you elaborate, because I try, but are unable to see why this is Bad?
Just that, unless I'm mistaken, anacron seems designed more for workstations than servers. It's been a long time and maybe I'm not recalling correctly, but it didn't seem that anacron allowed control to make sure that jobs ran at very specific times(?).

Tom
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 2889
Location: Illinois, USA

PostPosted: Mon Apr 08, 2019 2:35 pm    Post subject: Reply with quote

IIRC, anacron runs jobs that were scheduled but couldn't run because the system was down. That is more workstation oriented but important to servers also in business.
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 3699
Location: Dallas area

PostPosted: Mon Apr 08, 2019 4:52 pm    Post subject: Reply with quote

anacron is designed for cron jobs when the system is not up 24x7, laptop, workstation, etc.
Less useful for a server but I opted to install it anyway, not like it takes up a lot of space and if I need it, it's there.

Cronie can run in either anacron mode or vixie mode, just depends on the crontab files used.
And in anacron mode it will still run daily/weekly/monthly stuff w/anacrontab.
Also in anacron mode it runs jobs in /etc/hourly, similar to daily/weekly/monthly but on an hourly basis an alternative to individual crontabs for users.
_________________
Asus m5a99fx, FX 8320 - nouveau & radeon, oss4
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
4.14.62 kernel, profile 17.0 (no-pie) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5588
Location: Removed by Neddy

PostPosted: Thu Apr 11, 2019 12:00 pm    Post subject: Reply with quote

Whether this is a coincidence or not, but Pottering is advocating dropping a few things from Fedora

https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/UFGNO5MTPCLEK5B5RCJGGZUFTZ7JTWI5/

Quote:

3. atd? Do we still need that? Do we have postinst scripts that need
this? If so, wouldn't systemd-run be a better approach for those?
Isn't it time to make this an RPM people install if they want it?

4. Similar crond. On my fresh install it's only used by "zfs-fuse",
which I really wonder why it even is in the default install? And
"mdadm" wants this too. (which would be great if it would just use
timer units)

_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
asturm
Developer
Developer


Joined: 05 Apr 2007
Posts: 6831
Location: Austria

PostPosted: Thu Apr 11, 2019 12:36 pm    Post subject: Reply with quote

Sounds like a debate about default installed packages, not dropping entirely.
_________________
backend.cpp:92:2: warning: #warning TODO - this error message is about as useful as a cooling unit in the arctic
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1717

PostPosted: Fri Apr 12, 2019 9:16 am    Post subject: Reply with quote

Quote:
anacron is designed for cron jobs when the system is not up 24x7, laptop, workstation, etc.
Less useful for a server but I opted to install it anyway
It is very useful when you have shitloads of servers that depend on periodic updates from another system... without killing it with a sudden load spike, when all those crons fire at the same time.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum