{"id":1482,"date":"2025-11-09T11:45:42","date_gmt":"2025-11-09T17:45:42","guid":{"rendered":"https:\/\/www.nathanhunstad.com\/blog\/?p=1482"},"modified":"2025-11-09T11:45:43","modified_gmt":"2025-11-09T17:45:43","slug":"scheduling-auto-shutdown-with-nut","status":"publish","type":"post","link":"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/","title":{"rendered":"Scheduling auto-shutdown with NUT"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">In my <a href=\"https:\/\/www.nathanhunstad.com\/blog\/2025\/10\/building-nut-from-source-on-ubuntu\/\" target=\"_blank\" rel=\"noopener\" title=\"\">last blog post<\/a>, I walked through building NUT from source to monitor my new APC UPS. Why monitor a UPS? While one benefit is that I can get a bunch of pretty graphs for my Kibana dashboard, there&#8217;s a much more practical reason: monitoring the UPS allows my servers to shut themselves off if necessary on a set schedule. In this blog post I&#8217;ll explain how I set this up.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p class=\"wp-block-paragraph\">There are many reasons to use a UPS, and one is to allow for a clean shutdown when the power goes out, instead of just hoping for the best as power drops with no warning. This can work fine, but in my case I have a goal of maximizing the runtime of my UPS for my network. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For my setup, I have my fiber modem, router, and switches on my UPS in addition to a couple of servers. I could just let them all run on battery power until it runs out, but instead I want to shut my servers down if the power is out for more than a few minutes as opposed to just a temporary blip. Fortunately, this is a doable task, and below is how I did it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Basic configuration<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There are a couple of binaries you need to set up to monitor UPS status: <code>upsd <\/code>and<code> upsmon<\/code>. <code>Upsd<\/code> is the daemon that serves data to clients that are monitoring a UPS, and <code>upsmon<\/code> does the monitoring, natch. First comes <code>upsd<\/code>: since I want other servers to be able to get data on the UPS over the network, I added the following to <code>upsd.conf<\/code> in <code>\/etc\/nut <\/code>to allow <code>upsd<\/code> to listen on the network interface:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>LISTEN 0.0.0.0 3493<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next came <code>upsd.users<\/code>, which allows for some minimal amount of access control. Nothing fancy here nor a strong password, since this is all internal and I&#8217;m not terribly worried about security. This is the user I added to <code>upsd.users<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>        &#91;upsmon]\n                password = secret\n                upsmon primary\n                actions = SET\n                instcmds = ALL\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After that I moved on to the <code>upsmon<\/code> configuration. There is some <a href=\"https:\/\/networkupstools.org\/docs\/man\/upsmon.html\" target=\"_blank\" rel=\"noopener\" title=\"\">good documentation<\/a> available which came in handy, since I needed to set up a few options here. First was the MONITOR block:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MONITOR apcups@localhost 1 upsmon secret primary<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This says I want to monitor my APC UPS on localhost, using the username and super-secret password above. &#8220;Primary&#8221; means that the UPS is connected to the host that <code>upsmon<\/code> is running on, versus a different host. Easy!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Getting fancy with upssched<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Next, I needed to modify how we wanted to handle shutdowns. By <a href=\"https:\/\/networkupstools.org\/docs\/user-manual.chunked\/Configuration_notes.html\" target=\"_blank\" rel=\"noopener\" title=\"\">default<\/a>, <code>upsmon<\/code> will not signal a shutdown until the battery reaches a critical level. This is not what I wanted however: I want to shut down my servers well before that. As a result, I needed to do something <a href=\"https:\/\/networkupstools.org\/docs\/user-manual.chunked\/Advanced_usage_scheduling_notes.html\" target=\"_blank\" rel=\"noopener\" title=\"\">advanced<\/a>: use <code>upssched<\/code> to schedule a shutdown after X minutes on battery power. This required a bit of extra work.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Step one: set the <code>NOTIFYCMD<\/code> in <code>upsmon.conf<\/code> to <code>upssched<\/code>. For whatever reason, the example in the file they gave had the wrong path, so make sure you run &#8220;which upssched&#8221; to get the right one! In my case it was this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>NOTIFYCMD \/usr\/sbin\/upssched<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now we need to have <code>upsmon<\/code> run that binary when we get a few key messages: when the UPS is on battery, when it is back on line power, and when the battery is critical (just for funsies). I did this by modifying the <code>NOTIFYFLAG<\/code> lines as such to add <code>EXEC<\/code> to those flags, which as the documentation says will signal to <code>NOTIFYCMD<\/code> when those events happen:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>NOTIFYFLAG ONLINE       SYSLOG+WALL+EXEC\nNOTIFYFLAG ONBATT       SYSLOG+WALL+EXEC\nNOTIFYFLAG LOWBATT      SYSLOG+WALL+EXEC<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That brought me to the <code>upssched.conf<\/code> file, which needed a few changes as well. The <code>CMDSCRIPT<\/code> stayed the same, but I modified it with the changes below. The <code>PIPEFN<\/code> and <code>LOCKFN<\/code> lines gave me a lot of trouble until I modified those lines as well to provide the right permissions for the stated files, since the wrong permissions resulted in <code>upssched<\/code> failing to run for my first tests. This is what I used:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PIPEFN \/run\/nut\/upssched\/upssched.pipe\nLOCKFN \/run\/nut\/upssched\/upssched.lock<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, the heart of the work. For my monitoring server, I wanted it to shut down after 5 minutes on battery power. <code>Upssched<\/code> has timers to do this, so I added this pair of lines to start the timer when running on battery, and crucially cancel it when back on line power:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>AT ONBATT * START-TIMER timedshutdown 300\nAT ONLINE * CANCEL-TIMER timedshutdown<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">What is <code>timedshutdown<\/code>? That&#8217;s essentially the argument that is passed to the <code>CMDSCRIPT<\/code> when the timer is done. Remember a few paragraphs up when I said I changed this?  As the doc says, it&#8217;s basically one big case..esac block, so I put the following block in to handle that <code>timedshutdown<\/code> signal:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>        timedshutdown)\n                # Set shutdown flag\n                \/usr\/sbin\/upsmon -c fsd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That last line is what sets forced shutdown mode. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To sum up what I did:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>If the UPS is on battery, start a timer for 5 minutes<\/li>\n\n\n\n<li>When the timer reaches 0, set the forced shutdown flag<\/li>\n\n\n\n<li>If the UPS gets back on line power before 5 minutes is up, then cancel the timer<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Monitoring remotely<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">That took care of my primary monitoring server, but I have more than one server I want to monitor the UPS. For remote monitoring from my other server, I did the same thing with a few tweaks:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>the MONITOR line in upsmon.conf has the server name instead of localhost, and &#8220;secondary&#8221; instead of &#8220;primary&#8221;.<\/li>\n\n\n\n<li>I want the secondary servers to shut down first, so I set a shorter timer (3 minutes).<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">The test<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After all of this was configured and I figured out the pipe and lock file permissions, it was time for the test: I pulled the power plug for the UPS and waited. As configured, one server shut down at 3 minutes and the other at 5. Success!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With this setup, if I experience a lengthy power outage, I will lose my nice Elastic dashboards, Home Assistant, and other apps running on those servers, but hopefully I will be able to use my network for as long as possible.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Read on to learn how to use upsmon and upssched to shut down a server on a timer when on UPS battery.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[19],"tags":[21,308],"class_list":["post-1482","post","type-post","status-publish","format-standard","hentry","category-tech-2","tag-linux","tag-ups","entry"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Read on to learn how to use upsmon and upssched to shut down a server on a timer when on UPS battery.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Nathan Hunstad\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"The blog of Nathan Hunstad |\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Scheduling auto-shutdown with NUT | The blog of Nathan Hunstad\" \/>\n\t\t<meta property=\"og:description\" content=\"Read on to learn how to use upsmon and upssched to shut down a server on a timer when on UPS battery.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.nathanhunstad.com\/blog\/wp-content\/uploads\/2023\/05\/facicon-stretched.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/www.nathanhunstad.com\/blog\/wp-content\/uploads\/2023\/05\/facicon-stretched.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"484\" \/>\n\t\t<meta property=\"og:image:height\" content=\"258\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2025-11-09T17:45:42+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2025-11-09T17:45:43+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Scheduling auto-shutdown with NUT | The blog of Nathan Hunstad\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Read on to learn how to use upsmon and upssched to shut down a server on a timer when on UPS battery.\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.nathanhunstad.com\/blog\/wp-content\/uploads\/2023\/05\/facicon-stretched.jpg\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/2025\\\/11\\\/scheduling-auto-shutdown-with-nut\\\/#article\",\"name\":\"Scheduling auto-shutdown with NUT | The blog of Nathan Hunstad\",\"headline\":\"Scheduling auto-shutdown with NUT\",\"author\":{\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/author\\\/huns0004\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/2025\\\/11\\\/scheduling-auto-shutdown-with-nut\\\/#articleImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c5113ffdbe47c3095654b9158d4f067a549f1c82013a3f3c5dd7773d3f4b5be0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Nathan Hunstad\"},\"datePublished\":\"2025-11-09T11:45:42-06:00\",\"dateModified\":\"2025-11-09T11:45:43-06:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/2025\\\/11\\\/scheduling-auto-shutdown-with-nut\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/2025\\\/11\\\/scheduling-auto-shutdown-with-nut\\\/#webpage\"},\"articleSection\":\"Tech, Linux, UPS\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/2025\\\/11\\\/scheduling-auto-shutdown-with-nut\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/category\\\/tech-2\\\/#listItem\",\"name\":\"Tech\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/category\\\/tech-2\\\/#listItem\",\"position\":2,\"name\":\"Tech\",\"item\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/category\\\/tech-2\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/2025\\\/11\\\/scheduling-auto-shutdown-with-nut\\\/#listItem\",\"name\":\"Scheduling auto-shutdown with NUT\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/2025\\\/11\\\/scheduling-auto-shutdown-with-nut\\\/#listItem\",\"position\":3,\"name\":\"Scheduling auto-shutdown with NUT\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/category\\\/tech-2\\\/#listItem\",\"name\":\"Tech\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/#person\",\"name\":\"Nathan Hunstad\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/2025\\\/11\\\/scheduling-auto-shutdown-with-nut\\\/#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c5113ffdbe47c3095654b9158d4f067a549f1c82013a3f3c5dd7773d3f4b5be0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Nathan Hunstad\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/author\\\/huns0004\\\/#author\",\"url\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/author\\\/huns0004\\\/\",\"name\":\"Nathan Hunstad\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/2025\\\/11\\\/scheduling-auto-shutdown-with-nut\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c5113ffdbe47c3095654b9158d4f067a549f1c82013a3f3c5dd7773d3f4b5be0?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Nathan Hunstad\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/2025\\\/11\\\/scheduling-auto-shutdown-with-nut\\\/#webpage\",\"url\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/2025\\\/11\\\/scheduling-auto-shutdown-with-nut\\\/\",\"name\":\"Scheduling auto-shutdown with NUT | The blog of Nathan Hunstad\",\"description\":\"Read on to learn how to use upsmon and upssched to shut down a server on a timer when on UPS battery.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/2025\\\/11\\\/scheduling-auto-shutdown-with-nut\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/author\\\/huns0004\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/author\\\/huns0004\\\/#author\"},\"datePublished\":\"2025-11-09T11:45:42-06:00\",\"dateModified\":\"2025-11-09T11:45:43-06:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/\",\"name\":\"The blog of Nathan Hunstad\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.nathanhunstad.com\\\/blog\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Scheduling auto-shutdown with NUT | The blog of Nathan Hunstad","description":"Read on to learn how to use upsmon and upssched to shut down a server on a timer when on UPS battery.","canonical_url":"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/#article","name":"Scheduling auto-shutdown with NUT | The blog of Nathan Hunstad","headline":"Scheduling auto-shutdown with NUT","author":{"@id":"https:\/\/www.nathanhunstad.com\/blog\/author\/huns0004\/#author"},"publisher":{"@id":"https:\/\/www.nathanhunstad.com\/blog\/#person"},"image":{"@type":"ImageObject","@id":"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/#articleImage","url":"https:\/\/secure.gravatar.com\/avatar\/c5113ffdbe47c3095654b9158d4f067a549f1c82013a3f3c5dd7773d3f4b5be0?s=96&d=mm&r=g","width":96,"height":96,"caption":"Nathan Hunstad"},"datePublished":"2025-11-09T11:45:42-06:00","dateModified":"2025-11-09T11:45:43-06:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/#webpage"},"isPartOf":{"@id":"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/#webpage"},"articleSection":"Tech, Linux, UPS"},{"@type":"BreadcrumbList","@id":"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.nathanhunstad.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.nathanhunstad.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.nathanhunstad.com\/blog\/category\/tech-2\/#listItem","name":"Tech"}},{"@type":"ListItem","@id":"https:\/\/www.nathanhunstad.com\/blog\/category\/tech-2\/#listItem","position":2,"name":"Tech","item":"https:\/\/www.nathanhunstad.com\/blog\/category\/tech-2\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/#listItem","name":"Scheduling auto-shutdown with NUT"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.nathanhunstad.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/#listItem","position":3,"name":"Scheduling auto-shutdown with NUT","previousItem":{"@type":"ListItem","@id":"https:\/\/www.nathanhunstad.com\/blog\/category\/tech-2\/#listItem","name":"Tech"}}]},{"@type":"Person","@id":"https:\/\/www.nathanhunstad.com\/blog\/#person","name":"Nathan Hunstad","image":{"@type":"ImageObject","@id":"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/c5113ffdbe47c3095654b9158d4f067a549f1c82013a3f3c5dd7773d3f4b5be0?s=96&d=mm&r=g","width":96,"height":96,"caption":"Nathan Hunstad"}},{"@type":"Person","@id":"https:\/\/www.nathanhunstad.com\/blog\/author\/huns0004\/#author","url":"https:\/\/www.nathanhunstad.com\/blog\/author\/huns0004\/","name":"Nathan Hunstad","image":{"@type":"ImageObject","@id":"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/c5113ffdbe47c3095654b9158d4f067a549f1c82013a3f3c5dd7773d3f4b5be0?s=96&d=mm&r=g","width":96,"height":96,"caption":"Nathan Hunstad"}},{"@type":"WebPage","@id":"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/#webpage","url":"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/","name":"Scheduling auto-shutdown with NUT | The blog of Nathan Hunstad","description":"Read on to learn how to use upsmon and upssched to shut down a server on a timer when on UPS battery.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.nathanhunstad.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/#breadcrumblist"},"author":{"@id":"https:\/\/www.nathanhunstad.com\/blog\/author\/huns0004\/#author"},"creator":{"@id":"https:\/\/www.nathanhunstad.com\/blog\/author\/huns0004\/#author"},"datePublished":"2025-11-09T11:45:42-06:00","dateModified":"2025-11-09T11:45:43-06:00"},{"@type":"WebSite","@id":"https:\/\/www.nathanhunstad.com\/blog\/#website","url":"https:\/\/www.nathanhunstad.com\/blog\/","name":"The blog of Nathan Hunstad","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.nathanhunstad.com\/blog\/#person"}}]},"og:locale":"en_US","og:site_name":"The blog of Nathan Hunstad |","og:type":"article","og:title":"Scheduling auto-shutdown with NUT | The blog of Nathan Hunstad","og:description":"Read on to learn how to use upsmon and upssched to shut down a server on a timer when on UPS battery.","og:url":"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/","og:image":"https:\/\/www.nathanhunstad.com\/blog\/wp-content\/uploads\/2023\/05\/facicon-stretched.jpg","og:image:secure_url":"https:\/\/www.nathanhunstad.com\/blog\/wp-content\/uploads\/2023\/05\/facicon-stretched.jpg","og:image:width":484,"og:image:height":258,"article:published_time":"2025-11-09T17:45:42+00:00","article:modified_time":"2025-11-09T17:45:43+00:00","twitter:card":"summary","twitter:title":"Scheduling auto-shutdown with NUT | The blog of Nathan Hunstad","twitter:description":"Read on to learn how to use upsmon and upssched to shut down a server on a timer when on UPS battery.","twitter:image":"https:\/\/www.nathanhunstad.com\/blog\/wp-content\/uploads\/2023\/05\/facicon-stretched.jpg"},"aioseo_meta_data":{"post_id":"1482","title":null,"description":null,"keywords":null,"keyphrases":{"focus":{"keyphrase":"NUT","score":80,"analysis":{"keyphraseInTitle":{"score":9,"maxScore":9,"error":0},"keyphraseInDescription":{"score":3,"maxScore":9,"error":1},"keyphraseLength":{"score":9,"maxScore":9,"error":0,"length":1},"keyphraseInURL":{"score":5,"maxScore":5,"error":0},"keyphraseInIntroduction":{"score":9,"maxScore":9,"error":0},"keyphraseInSubHeadings":{"score":3,"maxScore":9,"error":1},"keyphraseInImageAlt":[],"keywordDensity":{"type":"best","score":9,"maxScore":9,"error":0}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":{"faqs":[],"keyPoints":[],"titles":[],"descriptions":[],"socialPosts":{"email":[],"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"created":"2025-11-08 22:16:09","updated":"2025-11-09 18:00:12","seo_analyzer_scan_date":null,"focus_keyword":"NUT","additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.nathanhunstad.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.nathanhunstad.com\/blog\/category\/tech-2\/\" title=\"Tech\">Tech<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tScheduling auto-shutdown with NUT\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.nathanhunstad.com\/blog"},{"label":"Tech","link":"https:\/\/www.nathanhunstad.com\/blog\/category\/tech-2\/"},{"label":"Scheduling auto-shutdown with NUT","link":"https:\/\/www.nathanhunstad.com\/blog\/2025\/11\/scheduling-auto-shutdown-with-nut\/"}],"_links":{"self":[{"href":"https:\/\/www.nathanhunstad.com\/blog\/wp-json\/wp\/v2\/posts\/1482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nathanhunstad.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nathanhunstad.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nathanhunstad.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nathanhunstad.com\/blog\/wp-json\/wp\/v2\/comments?post=1482"}],"version-history":[{"count":2,"href":"https:\/\/www.nathanhunstad.com\/blog\/wp-json\/wp\/v2\/posts\/1482\/revisions"}],"predecessor-version":[{"id":1484,"href":"https:\/\/www.nathanhunstad.com\/blog\/wp-json\/wp\/v2\/posts\/1482\/revisions\/1484"}],"wp:attachment":[{"href":"https:\/\/www.nathanhunstad.com\/blog\/wp-json\/wp\/v2\/media?parent=1482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nathanhunstad.com\/blog\/wp-json\/wp\/v2\/categories?post=1482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nathanhunstad.com\/blog\/wp-json\/wp\/v2\/tags?post=1482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}