News for hackers. Stuff that matters.
Re:OpenBSD cron(8) now supports random ranges with steps by pengaru on Monday May 08, 2023 @02:35PM (#35865347)
> Ah, yes, lets add exclusive flock support to all binaries in the existence, just in case.

You are aware that flock(1) is a thing, right? And that a defacto core tenet of UNIX is composability of disparate programs that do one thing well?

Re:OpenBSD cron(8) now supports random ranges with steps by justsomehnguy on Monday May 08, 2023 @02:46PM (#35865493)
> You are aware that flock(1) is a thing, right?

No. Maybe I heard and even knew what it is, but I never needed it.

You know why?

My task scheduler supports running only one instance of the task so I don't need to reinvent the wheel every time I need something to run on schedule.

Just 'somebinary args args args', 'run only one instance' and I'm done.

> flock - manage locks from shell scripts

Well, yep. Reinventing the wheel each other time.

Thanks, I have some more important things (like browsing HN) than writing shitty shell scripts.

Re:OpenBSD cron(8) now supports random ranges with steps by pengaru on Monday May 08, 2023 @02:52PM (#35865555)
> No. Maybe I heard and even knew what it is, but I never needed it.

...

> Thanks, I have some more important things (like browsing HN) than writing shitty shell scripts.

Probably a good idea, before you dig that hole of incompetence any deeper.

We're talking about crond here, which is already running the scheduled commands via sh, it's inherently involving the shell. Welcome to *NIX.

Re:OpenBSD cron(8) now supports random ranges with steps by justsomehnguy on Monday May 08, 2023 @04:29PM (#35866647)
> efore you dig that hole of incompetence any deeper.

"Hur-dur! Look at me! Me mighty UNIX wizard! Bow to me!"

> running the scheduled commands via sh, it's inherently involving the shell. Welcome to *NIX.

Thanks, while you are running shell commands I'm running systems. I'm not interested in writing shell scripts for things what were solved decades ago.

Re:OpenBSD cron(8) now supports random ranges with steps by gsich on Monday May 08, 2023 @05:02PM (#35867020)
Better look into a mirror ...

Using cron (or systemd) to ensure only 1 instance is running is a valid approach.

Re:OpenBSD cron(8) now supports random ranges with steps by trasz4 on Monday May 08, 2023 @04:36PM (#35866726)
>Well, yep. Reinventing the wheel each other time.

Erm, no - flock(1) is a UNIX tool, a component if you will. It's the exact opposite of reinventing the wheel.

Not understanding the operating system you're using is fine, but it's good to at least know what you don't know.

Re:OpenBSD cron(8) now supports random ranges with steps by justsomehnguy on Tuesday May 09, 2023 @01:30AM (#35870520)
> It's the exact opposite of reinventing the wheel.

If I need to write a wrapper script each time I need to run a task on a timer - then it is the proverbial reinventing the wheel. It doesn't matter if you call it a tool, utility or a component. Especially if this was solved decades ago.

> Not understanding the operating system you're using is fine

Ah, another mighty UNIX wizard here.

Re:OpenBSD cron(8) now supports random ranges with steps by trasz4 on Tuesday May 09, 2023 @02:28AM (#35870829)
>If I need to write a wrapper script

And there's your problem - you don't realize "writing a wrapper script" is actually simpler than messing with config files.

Re:OpenBSD cron(8) now supports random ranges with steps by justsomehnguy on Tuesday May 09, 2023 @10:24AM (#35874780)
The 'problem' here is you, serving the machine. I prefer the machine to serve me.
Re:OpenBSD cron(8) now supports random ranges with steps by winrid on Tuesday May 09, 2023 @02:04PM (#35878150)
Using utilities included with your OS is not the machine serving you?
Re:OpenBSD cron(8) now supports random ranges with steps by justsomehnguy on Tuesday May 09, 2023 @03:45PM (#35879463)
Using obsolete utilities for the sake of 'doing the right UNIX way' instead of just ticking a checkbox/adding one line in the task configuration?

Come on, I would repeat it again - it was solved for decades. Why do you need to do the things like it's 1976? Why do you insist everyone else should do that way too and abandon the fruits of the digital age?

Re:OpenBSD cron(8) now supports random ranges with steps by winrid on Wednesday May 10, 2023 @11:59AM (#35889257)
Why would you use something other than cron for many types of tasks? Not everyone needs a distributed system to run a script periodically, they want to actually get things done. :)
Re:OpenBSD cron(8) now supports random ranges with steps by ori_b on Wednesday May 10, 2023 @04:02PM (#35892700)
> Why do you need to do the things like it's 1976?

It was solved decades ago: in 1976. I don't understand why you feel like it wasn't.

Re:OpenBSD cron(8) now supports random ranges with steps by ori_b on Wednesday May 10, 2023 @04:01PM (#35892684)
Why is using the composable OS feature reinventing the wheel?
Re:OpenBSD cron(8) now supports random ranges with steps by joosters on Monday May 08, 2023 @03:34PM (#35866023)
a defacto core tenet of UNIX is composability of disparate programs that do one thing well?

cron goes completely against that principle - after all, you can schedule jobs with the 'at' command, and to make a repeating task, you just make it exec 'at' again each time it is called. cron is for the lazy, no real UNIX hacker would dream of using such an extravagant single-use program. /s