• 0 Posts
  • 7 Comments
Joined 3 years ago
cake
Cake day: June 28th, 2023

help-circle



  • I think if you know cron from the start it can be easier, but it gets really annoying really fast.

    Compare:

    0 0 * * * /usr/bin/flock -n /tmp/myjob.lock bash -c 'sleep $((RANDOM % 3600)) && /usr/local/bin/myjob.sh'
    

    To:

    [Timer]
    OnCalendar=daily
    RandomizedDelaySec=1h
    

    That and things like systemd preventing overlapped delays, handing what to do if the system was down during the last cycle, built in logging and event tracking. Seeing successful vs non successful runs etc.

    Once you add in those production requirements cron gets annoying fast and timers are easy.


  • The main functional difference between systemd and others is that systemd will just work. Others will require you hand tune and hand tinker with a non-mainstream Linux distro.

    If your hobby is init systems by all means mess around though.

    I personally quite like systemd. Unit files are clean, timers services and sockets are easy to manage etc.

    Honestly it’s a non-problem. Best advice is to use what is best supported. Don’t let the extremely fringe (but loud) tiny group of systemd haters throw you off.