Run bash (.sh) via launchd using a plist in /Library/LaunchAgents — by VikingOSX and etresoft on Apple Community
VikingOSX shows a working LaunchAgent for a shell script: plist in ~/Library/LaunchAgents with 644 permissions, Label, RunAtLoad, StartInterval and full paths only. The original poster got theirs working after moving the script out of ~/Documents, and etresoft points to privacy permissions instead, noting shell scripts silently fail without Full Disk Access.
Quick steps
- Use full paths with no ~ or variables
- Set StartInterval in seconds (e.g. 900)
- Check with launchctl print gui/<uid> (etresoft's tip)
Paraphrased from the source. Menus can differ by version, so check the original for full details.
Source: Run bash (.sh) via launchd using a plist in /Library/LaunchAgents by VikingOSX and etresoft on Apple Community. Licence: Link only (©).
- Source reviewed
- 2026-11-02
- Link checked
- 2026-11-02
- Tested hands-on
- Not by Oddbyte.Me