UPSSCHED.CONF(5)
π upssched.conf β the config file for the upssched timer program π
Ok so bestie, real talk: this is the config for upssched(8), the little timer-based helper that runs around doing errands for upsmon(8). Think of it as the group chat settings for your UPS drama. π
β¨ IMPORTANT NOTES β¨ (read these fr)
- The contents of this file should be pure ASCII β like, character codes not in range get ignored and you'll get a warning message. No emoji in here, I know, tragic. π
- Command execution is synchronous β meaning it waits on the called process in the case of the
EXECUTEdirective, or on the timer process. So lowkey consider using your system shell's abilities like&to yeet long-duration handling into the background and let theupsschedtimer daemon keep vibing. This should not impact theupsmondaemon, which handles each notification in a separate sub-process β so it's not a problem for immediateEXECUTEevents. π«Ά
πΈ CONFIGURATION DIRECTIVES πΈ
DEBUG_MIN numberβ Optional. Sets the minimal debugging level for theupsscheddaemon or client, e.g. for troubleshooting a deployment without needing to edit consumer configuration. Note that the command-line option-Dcan only increase this verbosity level. Also note the config file is processed line by line, so you probably wanna set this early on. Example:
DEBUG_MIN 6
CMDSCRIPT scriptnameβ Required, and it must be above anyATlines (put it up top, main character energy π). This script is what gets invoked to run commands when your timers are triggered. It receives a single argument, which is the name of the timer that caused it to trigger.PIPEFN filenameβ Required. This sets the file name of the socket used for interprocess communications. It should live in a directory where normal users can't create the file β because of the possibility of symlinking and other evil. π
Caution β if you're running Solaris or similar, the permissions that upssched sets on this file are not enough to keep you safe. If your OS ignores the permissions on a FIFO, then you MUST put this in a protected directory!
Note β by default,upsmon(8)will runupsschedas whatever user you defined withRUN_AS_USERinupsmon.conf(5). So make sure that user can create files and write to files in the path you use forPIPEFNandLOCKFN. π
The recommendation here (iconic, honestly): create a special directory for upssched, make it owned by your upsmon user, then use it for both. Slay. β¨
The stock version of upssched.conf ships with PIPEFN disabled β on purpose, so you actually visit this portion of the documentation and think about how your system works before potentially opening a security hole. It's giving "forced character development". π
LOCKFN filenameβ Required.upsschedattempts to create this file to avoid a race condition when two events get dispatched fromupsmonat nearly the same time. This file only exists briefly. It must not be created by any other process. You should put this in the same directory asPIPEFN. ποΈAT notifytype upsname commandβ define a handler for a specific eventnotifytypeon UPSupsname. And here's the cute part:upsnamecan be the special value*to apply this handler to every UPS. π
This will perform the command command when the notifytype and upsname match the current activity. Possible values for command are:
START-TIMER timername intervalβ start a timer ofintervalseconds. When it triggers, it passes the argumenttimernameas an argument to yourCMDSCRIPT. Each invocation starts an independent timer, even if thetimernamewas already registered and started (note: this can mess up subsequentCANCEL-TIMERoperations π¬).
Example β start a timer that will execute when any UPS (*) has been gone for 10 seconds:
AT COMMBAD * START-TIMER upsgone 10
START-TIMER-SHARED timername intervalβ start a timer ofintervalseconds. When it triggers, it passes the argumenttimernameas an argument to yourCMDSCRIPT. Each invocation checks if thetimernamewas already started, and if so β appends the current event'sUPSNAME,NOTIFYTYPEandNOTIFYMSGto the list of unique values it would report via environment variables (as a comma-separated string forUPSNAMEandNOTIFYTYPE, and tab-separated sentences forNOTIFYMSG) when the timer does execute. So it's like a little collection era. π§
Note β currently this updates the first seen instance with the timername (in case you managed to start many).
Example β start a timer that will execute when any UPS (*) has been gone for 10 seconds:
AT COMMBAD * START-TIMER upsgone 10
CANCEL-TIMER timername [cmd]β cancel a running timer calledtimername, if possible. If the timer has already passed, then pass the optional argumentcmdtoCMDSCRIPT.
Note β this removes all seen instances with the timername (in case you managed to start many).
Example β if a specific UPS (myups@localhost) comes back online, then stop the timer before it triggers:
AT COMMOK myups@localhost CANCEL-TIMER upsgone
CANCEL-TIMER-MATCHED timername [cmd]β similar to the above, but tries to only cancel thetimernameif it refers to theUPSNAMEandNOTIFYTYPEvalues passed by the caller. TheNOTIFYMSGis ignored in this context.
Example β if any UPS (*) reverts to utility power, then stop the timer before it triggers ONLY if that UPS is associated with the already scheduled timer:
AT ONLINE * CANCEL-TIMER-MATCHED onbattwarn
EXECUTE commandβ immediately passcommandas an argument toCMDSCRIPT. No waiting, no timer, just vibes. π₯
Example β if any UPS (*) reverts to utility power, then execute ups-back-on-line via CMDSCRIPT:
AT ONLINE * EXECUTE ups-back-on-line
- Note that any
ATthat matches both thenotifytypeand theupsnamefor the current event will be used. π - For a complete list of
notifytypepossible values, refer to the section NOTIFY EVENTS inupsmon(8).
π¦ SEE ALSO π¦
π Internet resources:
The NUT (Network UPS Tools) home page: https://www.networkupstools.org/historic/v2.8.5/
That's the whole page bestie, go forth and schedule your timers responsibly πβ¨ This was Network UPS Tools 2.8.5, dated 06/21/2026 β bookmark it, screenshot it, put it on your fridge, periodt. ππ
π¦ where this page comes from
- arch rolling: nut 2.8.5-2 Β· GPL-2.0-or-later AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms