[MacTUG] controlling the time on a LaunchAgent

Donald Duff-McCracken dsmccrac at uwaterloo.ca
Mon Apr 11 11:25:03 EDT 2016


So thanks Dawn to pointing out the app LaunchControl (http://launchd.info/) as a nice GUI tool for Launch Agents and Daemons.

What I like:


  *   You are not locked into using it if you create a launch agent/daemon: It just creates ‘nice normal’ XML plist files that you can manually tweak if you feel that LaunchControl is not to your liking or just not doing what you want it to.
  *   It reads normal locations for these files and lets you edit an existing agent or daemon.
  *   I also like that it has an unload/load function so you can change a agent/daemon and then test the results.
  *   It saves the files with the correct ownership and permissions

The only thing I wish it would do is that it does not appear to have just a plain text editor/viewer built in. I would like to see the plist as plain text and I need to hope out of LaunchControl to do this. (I know it has Expert Mode — which works more like a plist editor — but it is not the same as seeing the whole thing as plain xml

While I still feel like I am cheating when I use something like this, haha, it likely is going to make less syntax errors than I will do I will likely use it in the future.

BTW: It could do the tedious task I wanted it to do (write the code to run a script every 5 minutes for a given period of time, each day), but upon further reflection I decided that I wanted it to run the script every X minutes all day as the info it was generating was good to have and the system overhead was trivial. So while I will use it in the future, I decided that my existing Launch Agent is doing what I wanted it to do after all!
------------------------------------
Donald Duff-McCracken
Technical Services Manager
Mapping, Analysis & Design
Faculty of Environment
University of Waterloo
(519) 888-4567 x32151
https://uwaterloo.ca/environment-computing/about/people
------------------------------------
This email communication is intended as a private communication for the sole use of the primary addressee and those individuals listed for copies in the original message. The information contained in this email is private and confidential and If you are not an intended recipient you are hereby notified that copying, forwarding or other dissemination or distribution of this communication by any means is prohibited.  If you are not specifically authorized to receive this email and if you believe that you received it in error please notify the original sender immediately.

From: <mactug-bounces at lists.uwaterloo.ca<mailto:mactug-bounces at lists.uwaterloo.ca>> on behalf of Dawn Keenan
Date: Friday, April 8, 2016 at 4:20 PM
To: "mactug at lists.uwaterloo.ca<mailto:mactug at lists.uwaterloo.ca>"
Subject: Re: [MacTUG] controlling the time on a LaunchAgent

Scroll down to "Cron-style time specifications" on http://launchd.info/ (tl;dr: it's tedious unless you use LaunchControl)

On 4/8/16 4:04 PM, Donald Duff-McCracken wrote:
Greetings

I have a launch agent that is running every 5 minutes on a server. It is working fine. I really only need it to check the process during working hours.I would like to only have it check during working hours.

I know how to get it to run every X seconds (which is what I am doing now).


         <key>StartInterval</key>


        <integer>300</integer>


 I also know how to get it to run at a specific time or day.

    <key>StartCalendarInterval</key>

        <key>Minute</key>
        <integer>45</integer>
        <key>Hour</key>
        <integer>13</integer>
        <key>Day</key>
        <integer>7</integer>

But I don’t know how to get it to run during a range of time, and every X seconds during that time. It is not really hurting running after working hours, it just sort of conceptually bugs me that it is doing it! ;-)

Does anyone know the syntax to have a launch agent/daemon run every 5 minutes from 8 to 5? As I said it is not hurting anything running, so don’t waste time on an answer but if you want to show off, here is a chance ;-)
------------------------------------
Donald Duff-McCracken
Technical Services Manager
Mapping, Analysis & Design
Faculty of Environment
University of Waterloo
(519) 888-4567 x32151
https://uwaterloo.ca/environment-computing/about/people
------------------------------------
This email communication is intended as a private communication for the sole use of the primary addressee and those individuals listed for copies in the original message. The information contained in this email is private and confidential and If you are not an intended recipient you are hereby notified that copying, forwarding or other dissemination or distribution of this communication by any means is prohibited.  If you are not specifically authorized to receive this email and if you believe that you received it in error please notify the original sender immediately.



_______________________________________________
MacTUG mailing list
MacTUG at lists.uwaterloo.ca<mailto:MacTUG at lists.uwaterloo.ca>https://lists.uwaterloo.ca/mailman/listinfo/mactug


--
Dawn Keenan
IT Director, Arts Computing Office, University of Waterloo
dkeenan at uwaterloo.ca<mailto:dkeenan at uwaterloo.ca>
519-888-4567 x32157
PAS 2081A
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uwaterloo.ca/pipermail/mactug/attachments/20160411/b5f12cd0/attachment-0001.html>


More information about the MacTUG mailing list