Skip to content
This repository was archived by the owner on Nov 14, 2025. It is now read-only.

[Fix] Run startup script at boot #10

@aleixsr

Description

@aleixsr
  1. sudo crontab -e
  2. * * * * * env > /tmp/cronenv
  3. Save crontab :wq
  4. Wait until file /tmp/cronenv exists
  5. sudo crontab -e
  6. Comment previous line using #: #* * * * * env > /tmp/cronenv
  7. Add new line @reboot /Users/<your_username>/Scripts/startup.sh >/tmp/cron_stdout.log 2>/tmp/cron_stderr.log
  8. Save crontab :wq
  9. Run shell simulating crontab environment: sudo env - `cat /tmp/cronenv` /bin/sh
  10. Create startup script file vim /Users/<your_username>/Scripts/startup.sh
  11. Edit your script as you want as save it: :wq
  12. Give execution permissions to script: chmod +x /Users/<your_username>/Scripts/startup.sh
  13. Run your script to test if it works: /Users/<your_username>/Scripts/startup.sh
  14. Reboot and check if it works: more /tmp/cron_std*.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions