Skip to content

Instantly share code, notes, and snippets.

@todgru
Created November 4, 2024 22:38
Show Gist options
  • Save todgru/a9aec7df0b9f81e1eff73321763deaca to your computer and use it in GitHub Desktop.
Save todgru/a9aec7df0b9f81e1eff73321763deaca to your computer and use it in GitHub Desktop.
mac os x schedule not cron zsh

sched

One off jobs in Mac OS X can be scheduled using the zsh command sched

to run a script in 10 minutes:

sched +600 /path/to/my-script.sh

run a script at 12:30 local time:

sched 12:30 /path/to/my-script.sh

run shell command in 10 seconds (-o will clear the terminal line before event):

sched -o 10 echo "hello"

take a look at the currently scheduled jobs:

  • run sched with no arguments
  • environment variable echo $zsh_scheduled_events

remove item from schedule list by referencing the item number from sched commend. remove item number 3 from the list:

sched -3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment