this post was submitted on 01 Oct 2025
615 points (99.4% liked)

Programmer Humor

26827 readers
2156 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] dotslashme 31 points 1 week ago (3 children)

My current project has a crontab with 216 entries.

[–] pinball_wizard@lemmy.zip 34 points 1 week ago (3 children)

Well, here's a sentence I haven't been tempted to use before:

"I believe that may be too many crontab entries."

[–] DickFiasco@sh.itjust.works 19 points 1 week ago (2 children)

Any problem in server administration can be solved with an additional crontab entry. Except for the problem of too many crontab entries.

[–] Opisek@piefed.blahaj.zone 10 points 1 week ago* (last edited 1 week ago)

And that's why I added a crontab entry that periodically purges my cron configuration. That way, I'm forced to readd only the truly necessary cron jobs, successfully reducing the amount of crontab entries.

[–] curbstickle@anarchist.nexus 1 points 1 week ago

Which can be solved by an additional server.

Boom, problem solved.

[–] cupcakezealot@piefed.blahaj.zone 10 points 1 week ago (1 children)

just randomly delete 50 of them.

[–] pinball_wizard@lemmy.zip 17 points 1 week ago (1 children)

Yes. The strongest crontab entries will probably restore themselves. (For anyone reading along, this is sarcasm. Don't do this.)

a crontab can regenerate from bisection to form two whole crontabs

[–] rumba@lemmy.zip 3 points 1 week ago (1 children)

pshaw, just drop in there and combine a few

/etc/cron.d/first25 /etc/cron.d/second25 ...

[–] j_z@feddit.nu 2 points 1 week ago

This is the way. Exactly what we did + migrated 80% of everything to k8s cronjobs and Argo workflows

[–] Lightfire228@pawb.social 7 points 1 week ago

Use SystemD timers, you animal

[–] marcos@lemmy.world 5 points 1 week ago (2 children)

At some point it may be good to migrate to airflow or something similar.

It's not the number of entries that makes it bad. It's the fact that if you run crontab, they are gone...

[–] dondelelcaro@lemmy.world 9 points 1 week ago (1 children)

That's why there's a crontab rule to load the crontab from a file. Cronception if you will.

[–] marcos@lemmy.world 7 points 1 week ago (1 children)

Make the rule start a secondary cron system. Otherwise it won't run after you erase the crontab.

[–] dondelelcaro@lemmy.world 6 points 1 week ago* (last edited 1 week ago)

Here you go:

with-lock-ex -q /path/to/lockfile sh -c '
while true; do
    crontab cronfile;
    sleep 60;
done;'
[–] bleistift2@sopuli.xyz 8 points 1 week ago* (last edited 1 week ago) (1 children)

At first I thought you missed the -r. Then I checked. Defaulting to STDIN here is very, very dumb, IMHO. Almost as bad as putting the “edit” flag right next to the “delete everything without confirmation” flag on a Western keyboard (-e vs -r).

[–] marcos@lemmy.world 7 points 1 week ago

Crontab is a really badly designed program that we just can't fix because everybody depends on its WFTs for something.