2

On Linux, many distros ship with systemd. Systemd supports "timers", which are a kind of systemd service for running programs on a schedule. There are of course many ways of scheduling tasks, such as the venerable cron which was replaced by systemd. However, the benefits of systemd specifically are:

  • CLI with convenient commands to enable, disable and check the status of timers
  • Each scheduled task is entirely defined in a single text file
  • The timer syntax is very extensive with ways to cover different types of exceptional situations and corner cases

Is there a similar way of scheduling tasks in OS X? I am interested primarily in running command line programs and scripts, so GUI support is not important to me.

Allan
  • 101,432
Dommondke
  • 132
  • 4

1 Answers1

2

On Linux, many distros ship with systemd. Systemd supports "timers", which are a kind of systemd service for running programs on a schedule... Is there a similar way of scheduling tasks in OS X?

It’s called launchd.

From Wikipedia:

launchd is an init and operating system service management daemon created by Apple Inc. as part of macOS to replace its BSD-style init and SystemStarter. There have been efforts to port launchd to FreeBSD and derived systems

Additional Resources

Allan
  • 101,432
  • It looks like the scheduling is explained in https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/ScheduledJobs.html#//apple_ref/doc/uid/10000172i-CH1-SW2 – Dommondke Feb 25 '23 at 00:25
  • 1
    Thanks! I added that to the answer! – Allan Feb 25 '23 at 00:43
  • 1
    Also useful to read the related manual pages: man launchd and man launchctl. – informatik01 Feb 26 '23 at 13:58