13

On our Mac OS X (10.6) Server we have setup several backup scripts that are controlled by launchd and launched at specific times. For this we have defined StartCalendarInterval and this all works very well.

Now it happens that I would like to start one of these jobs out of schedule, but this does not start the job (but also does not give an error/warning):

sudo launchctl start org.job-label

The manpage of launchtl states that start is intended to test on-demand jobs, no word of scheduled jobs. Is there a way to kickstart scheduled jobs?


Edit after getting the response: Yes, manually starting scheduled jobs also works via the launchctl start command.

3 Answers 3

5

Hmm, maybe this helps to debug your issue:

Set the log level to debug:

sudo launchctl log level debug

Tail the system.log:

sudo tail -f /var/log/system.log &

Try to start your job again:

sudo launchctl start org.job-label

2
  • Ha, thanks, that helped. I only saw that the job wasn't running but forgot that it had its own error log, and there I found that it terminated early due to a missing directory. Fixed that, now I can start it via launchctl start org.job-label. Thanks for the nudge!
    – Pascal
    Mar 20, 2011 at 10:27
  • 2
    Unrecognized subcommand: log Jul 26, 2018 at 7:31
1

I tried to use sudo launchctl start foo to manually start a scheduled LaunchDaemon on macOS Ventura and it did not work.

However, I stumbled upon the kickstart subcommand of launchctl and it did work:

sudo launchctl kickstart foo

The description of the kickstart subcommand from the man page says:

 kickstart [-kp] service-target
         Instructs launchd to run the specified service immediately,
         regardless of its configured launch conditions.
0
sudo launchctl -w load /Library/LaunchDaemons(Agents)/org.job-label
1
  • This would load the job, which it already is, but not start it.
    – Pascal
    Mar 20, 2011 at 10:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .