Macos – Run Script every 30 Seconds on Mac

cronmacosshell-script

I have created a cronjob that runs every 60 seconds which is not frequent enough for me. It is a simple command: wget localhost How can I run this commenad every 30, 16 seconds on my mac?

Best Answer

Run your command using launchd instead. Use the property list files in ~/Library/LaunchAgents/ and /System/Library/LaunchAgents/ as inspiration. Documentation on developer.apple.com.

To specify a launch interval of e.g. 30 seconds, use the following:

<key>StartInterval</key>
<integer>30</integer>
Related Question