I want to install a startup item in OS X Big Sur which runs a shell script as a user on my machine and connects via ssh to a remote machine I maintain. I use ssh keys so no password is required for this script to succeed. It will linger in the background. How would I accomplish this in Big Sur? My understanding is that the old /Library/Startup Items/xxx.plist trick is deprecated. What is used in its place?
Thanks!
Don't have macOS Big Sur yet; however, in previous version of macOS there is System Preferences > Users & Groups > you > Login Items, or use a Launch Agent. (I assume these methods are still available in macOS Big Sur.)
Have a look at:
See also the manual pages for
launchd
andlaunchctl
in Terminal.- You can read the manual page for
command
in Terminal by typingcommand
and then right-click on it and select: Open man Page
- You can read the manual page for
launchd
has been the preferred way to run scripts (at any time, not just at login) sincecron
was deprecated. Whether it's Mavericks, El Cap, Catalina, or Big Sur,launchd
is the preferred way to go. – Allan Oct 23 '20 at 21:29