Newish to Linux and slowly learning lol. I recently got a podcast downloader working through rss with castget, works great. The command to get new eps that haven’t been downloaded is castget -c.

Is there a way to automate this, so the command runs say every day at a set time?

  • Static_Rocket@lemmy.world
    link
    fedilink
    English
    arrow-up
    17
    arrow-down
    1
    ·
    16 days ago

    There are users that still swear by cron, but on modern systems a systemd timer is generally advised.

    • Wolf314159@startrek.website
      link
      fedilink
      arrow-up
      1
      ·
      15 days ago

      They don’t even know cron exists and you’re going to throw them to the wolves by suggesting Systemd? That’s like calling in a drone strike to swat a mosquito.

    • davel [he/him]@lemmy.ml
      link
      fedilink
      English
      arrow-up
      1
      ·
      16 days ago

      If systemd is running, as it is on the great majority of distributions, then cron is running on top of it, as just another service. It’s not an either-or situation.

      • NoLemurs@lemmy.world
        link
        fedilink
        arrow-up
        5
        arrow-down
        1
        ·
        16 days ago

        It’s not. But the systemd timer has more robust logging and monitoring, and much more explicit and readable syntax.

        Once you get used to systemd timers, it’s really hard to see why you wouldn’t use them if your system has systemd. Unless writing crontabs by hand makes you feel like a hacker I guess. I’m not even being totally sarcastic about that - there is a fun retro feel to cron.

        • aksdb@lemmy.world
          link
          fedilink
          arrow-up
          4
          ·
          16 days ago

          I generally like their outcome, but hate the boilerplate. I think I need somewhere around 20 lines over two different files which would otherwise be a one-liner in a cron file.

          • NoLemurs@lemmy.world
            link
            fedilink
            arrow-up
            2
            arrow-down
            1
            ·
            16 days ago

            Yeah. Once you spend an afternoon debugging a failing cron job, the 5 minutes needed to write the boilerplate starts to feel pretty ok though.

            I’ve never had to spend an afternoon debugging a failing systemd timer in the years since I made the switch.

  • CameronDev@programming.dev
    link
    fedilink
    arrow-up
    7
    ·
    16 days ago

    cron/crontab are the general things you want to search for. They are used for running commands on a schedule, which is what you want.

    You can also use systemd timers. Pick the one that your OS supports.

    • imminent_nebula@lemmy.caOP
      link
      fedilink
      arrow-up
      2
      ·
      16 days ago

      Great, thank you. I heard about cron jobs when I first switched to Linux but got overwhelmed. Appreciate the link.

    • imminent_nebula@lemmy.caOP
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      16 days ago

      This seems way more straight forward than i remember lol. I’m on Cachy, which apparently doesn’t have cron out of the box. Just installed cronie, ran crontab -e, and if I enter:

      0 6 * * * * castget -c

      (with spaces between 0 6 * etc?) that’s it? It’ll run every day at 6am?