Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Shutting down Unraid gracefully at a certain time with User Scripts

Featured Replies

So since I actually only use my server during the evening, I would like it to only be on during certain times. I was able to use the BIOS setting to set the server to turn on every day at 15:30. However I also want Unraid to shut down every evening at 03:00.

 

I found that you can do this using User Scripts however I can't find the correct command to do it gracefully. I found the command 'shutdown now' but that doesn't quite seem to work. With the monitor attached I do see it's trying to shut down (it says 'Waiting up to 60 seconds for a graceful shutdown'), then it says it's Waiting for all processes to exit, then it says going to single user mode, and then it's back to the command line saying 'server login: _'. The computer doesn't actually turn off though - but also unraid will be inaccessible over the network. Whatever it's doing, it's not shutting it down but it's also not remaining accessible either.

 

In other posts I found the 'powerdown' command but that doesn't work at all for me, it does nothing.

I tried checking what UnRaid does when you click the shutdown button through the gui, and it says 'running shutdown script /etc/rc.d/rc.0:'. I assume that's what I need user scripts to schedule, but I'm not sure how to do it.

Could anybody advice me?

  • Author
2 minutes ago, Freighter said:

So since I actually only use my server during the evening, I would like it to only be on during certain times. I was able to use the BIOS setting to set the server to turn on every day at 15:30. However I also want Unraid to shut down every evening at 03:00.

 

I found that you can do this using User Scripts however I can't find the correct command to do it gracefully. I found the command 'shutdown now' but that doesn't quite seem to work. With the monitor attached I do see it's trying to shut down (it says 'Waiting up to 60 seconds for a graceful shutdown'), then it says it's Waiting for all processes to exit, then it says going to single user mode, and then it's back to the command line saying 'server login: _'. The computer doesn't actually turn off though - but also unraid will be inaccessible over the network. Whatever it's doing, it's not shutting it down but it's also not remaining accessible either.

 

In other posts I found the 'powerdown' command but that doesn't work at all for me, it does nothing.

I tried checking what UnRaid does when you click the shutdown button through the gui, and it says 'running shutdown script /etc/rc.d/rc.0:'. I assume that's what I need user scripts to schedule, but I'm not sure how to do it.

Could anybody advice me?

Okay after a little experimenting it seems like simply pasting '/etc/rc.d/rc.0' into the user script has the intended result and it runs the shutdown script the same as pressing the shutdown button does.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.