Prompt Every Day at 4:00PM

ksanborn
New Contributor III

We have a requirement to have a message appear on folks computers every day at 4:00PM to remind them to complete their timesheet. We have a script that displays the message but there doesn't appear to be an easy way to make it appear at 4:00PM each day. We have taken a look at the client side limitations but that only allows you to specify when the policy shouldn't run or when it should activate or deactivate.

4 REPLIES 4

brandonusher
Contributor II

Look into launch agents. There's a great post here

mm2270
Legendary Contributor III

LaunchDaemon or LaunchAgent would be the way to go. You're correct that trying to get a policy to fire off at an exact time of the day isn't exactly possible. The problem is the policy randomization comes into play, even if you could tell the policy itself to start at exactly 4 PM. There would still be some kind of random delay added to it. How much of one depends on your JSS settings. In our case because we have such a large amount of Macs, our randomization is anywhere up to 15 minutes. Even if yours is only set to 5 minutes, it would mean some Macs would may show the message at 4, some at 4:02, 4:04, 4:05 etc. Maybe that's not a huge deal, but if you really need it to happen exactly at 4, then a launchd job is going to be what you'll want to look at.

You could still have it be coming from an actual JSS policy, but set it up so it only triggers on a manual trigger call, and set to Ongoing frequency, scoped to whatever Macs it needs to show up on.

stevewood
Honored Contributor II
Honored Contributor II

@ksanborn a LaunchDaemon will be your best bet. You can drop your script on the system and set a LaunchDaemon to kick off at 4 pm every day. A good example can be found here:

Run script every day on OS X

And a good tutorial on launchd can be found here:

Launchd Tutorial

Grab a copy of Lingon, or the other app that @mm2270 promotes. Mike what was that other LaunchD creator app?

mm2270
Legendary Contributor III

@stevewood Probably LaunchControl. That's what I tend to use for my launchd jobs these days.