(You'll see other Mac launchd jobs running when you use the launchctl list command below, and I think after that, you'll agree that naming convention is a good idea.) 3) Tell macOS about your Mac plist launchd file Having programmed in Java, this is just like the Java package naming convention, and I have no problems following it. When using the commands that I'm about to show you, you'll refer to the filename and this "label", and they encourage you to follow this naming convention to avoid namespace collisions. This plist file can be read as "Run the script /Users/al/bin/crontab-test.sh every 60 seconds, and redirect the standard output and standard error as shown".Ī note about the naming convention: Apple strongly encourages you to use the naming convention I've shown here for (a) your filename and (b) your label value. In my case I fired up vi to edit my file:įollowing Apple's documentation (and after many errors), I ended up with these contents in my plist file: Next, create a Mac plist file in this directory to describe the job you want to run. 2) Create a Mac plist file to describe your job To keep this simple and just see how things work initially, my advice is to use the $HOME/Library/LaunchAgents folder until you see how things work, then use the other two system folders if/when necessary. Note that when you use the first two directories shown here, you must use the sudo command to edit your files. (When your plist configuration file is placed here, your job will be run under your username.)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |