• Bo7a@piefed.ca
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 months ago

    I’ve been doing this stuff for 30 years. The helpful blog post that took 8 pages of text to explain how to schedule a job just made me angry.

    I think I am finally into greybeard territory even though my beard made the change a few years ago. Damn.

    • esc@piefed.social
      link
      fedilink
      English
      arrow-up
      0
      ·
      3 months ago

      Why did it make you angry? Do you believe that there are other implementations that do the task better and simpler?

      • Bo7a@piefed.ca
        link
        fedilink
        English
        arrow-up
        0
        ·
        3 months ago

        I was mostly kidding. But the little bit that bothered me was the idea that ‘it is so simple here are 8 pages to barely scratch the surface.’

        cron works fine for me. And if I ever have to work in an environment where I can’t use cron and systemd is available, then of course I will use it. Thus far that has never been the case.

        • psycotica0@lemmy.ca
          link
          fedilink
          English
          arrow-up
          1
          ·
          3 months ago

          Yeah, I think it’s just the way the blog post was written. When I was reading it I saw the first few paragraphs was basically “here’s how to do Cron with it”, and then everything after that was “here’s a bunch of other features it has that cron doesn’t and how to use those”

          I don’t think that’s the wrong way to write this kind of article, but I could see it feeling overwhelming on a skim, because it may feel like you need to read the whole thing in order to get anything working. But actually only the start was necessary, and the rest was tasty feature pitch.

  • A_norny_mousse@piefed.zip
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 months ago

    Kinda agree; I’m surprised how often people use & recommend cron jobs even on systems that have been using systemd for a decade.

    • nous@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      3 months ago

      Cron jobs are nice and simple to create. Until they go wrong then they are a pain in the ass. You need to manage logging yourself. If you forget you root mail will fill up your disk and crash the system. If you forget the mailto setting. If you remember it you justlose all logs and have no clue why something is not working. You need to redirect the output to a logfile yourself. And then risk filling up the disk with logs unless you remember to also set up logrotate. And you then still don’t know when something last ran or if it ran successfully.

      So many traps and that is just the logging side of things.

      • qupada@fedia.io
        link
        fedilink
        arrow-up
        1
        ·
        3 months ago

        My favourite - and I’ve gotten into arguments with people about this who clearly never just tried it to see what happens - is it never executes things with the shell you think it will.

        So many people assume that just because their script says #!/bin/bash at the top that cron is going to run it in bash. The reality is without ALSO setting SHELL=/bin/bash in the crontab file, you’re getting your system’s lowest-common-denominator shell (ash/dash/sh/whatever other gross abomination).

        So much time wasted debugging. And I’m generally pretty good at avoiding shell-specific syntax, I’ve seen the abominations of shell scripts some people write.

        The one thing I do wish systemd timers offered is cron syntax backwards compatibility, rather than just its ISO8601-style time patterns. An every-5-minutes job that used to be */5 * * * * is now OnCalendar=*-*-* *:0/5:0 and I’m just not sure that syntax is universally an improvement.

      • A_norny_mousse@piefed.zip
        link
        fedilink
        English
        arrow-up
        0
        ·
        3 months ago

        yes and yes and yes, except:

        Cron jobs are nice and simple to create.

        So are systemd timers. Seriously. I understood this sort of argument in the years when systemd was relatively new, but nowadays … c’mon, it’s 2 config files in a very simple (the simplest form is just 2 headings with one variable definition each) and common format and (optionally) one command to reload the daemon.

        Maybe adding a line to your list of cron jobs is slightly quicker, but you have none of the things systemd offers on top.

        OK, tbf I don’t know how much (ana)cron provides. Cleaning up the process tree? Restart conditions? Avoiding service duplicates? Advanced starting & repeating like “5min after boot” or “only after this other service has succeeded”? Can it read abbreviations like ‘daily’ or does it all need to be in that cryptic cron syntax?

        • nous@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          ·
          3 months ago

          Its hard to argue that 2 config files both multiple lines long is simpler then a single line in an existing file. Adding a service to cron is just simpler. But adding all the extra bit you are going to want on top increases the things you need to learn to do and configure correctly.

          IMO systemd timers are simpler to get right at a little bit more of an upfront cost to learning how they work. But cron is still simpler to just get something working without caring that much. I still find that ends up biting you in the longer term though though all the missing features you need to add manually on top of that one basic line you added.

        • corsicanguppy@lemmy.ca
          link
          fedilink
          English
          arrow-up
          0
          ·
          3 months ago

          I understood this sort of argument in the years when systemd was relatively new,

          The ageism creeps out of this one.