Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Run startup script at boot #10

Open
aleixsr opened this issue Mar 9, 2023 · 0 comments
Open

[Fix] Run startup script at boot #10

aleixsr opened this issue Mar 9, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@aleixsr
Copy link
Owner

aleixsr commented Mar 9, 2023

  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
@aleixsr aleixsr added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant