It is always a struggle configuring a cronjob to run certain scripts; there is always a mis configuration, a PATH, an environment variable that is different from when you use it in interactive mode, etc… Do you have any tricks to avoid or minimize those issues?

cc @selfhost@lemmy.ml

  • skilltheamps@feddit.de
    link
    fedilink
    arrow-up
    10
    ·
    10 months ago

    Use a systemd-service + systemd-timer. You can then run “systemctl start myjob.service” to check that it runs as you expect. If it works “systemctl enable --now myjob.timer” to kick it off as scheduled