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