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.

Docker Start/Stop on Timer

Featured Replies

Don't think it's currently possible, but it would be nice to be able to start and / or stop a docker on a schedule. For example, only have download type dockers run overnight, or media servers running on evenings/weekends.  Likely not that simple to get a full featured scheduler in there, but might be nice.

Don't think it's currently possible, but it would be nice to be able to start and / or stop a docker on a schedule. For example, only have download type dockers run overnight, or media servers running on evenings/weekends.  Likely not that simple to get a full featured scheduler in there, but might be nice.

Use user.scripts plugin

 

Scripts would be something like

docker stop nameOfContainer

and

docker start nameOfContainer

  • Author

Thank you - off to play with that now

  • 3 months later...
On 1/15/2017 at 11:51 AM, Squid said:

Use user.scripts plugin

 

Scripts would be something like

 


docker stop nameOfContainer
 

 

and


docker start nameOfContainer
 

 

 

But having something built in for idiots like me would be helpful!

I wrote this script that I tell user.scripts to fire off every morning at 7AM-11AM to back up some stuff from my Mac

#!/bin/bash
#Start Docker
docker start resilio-sync

#Delay before issuing Stop
sleep 4h

#Stop Docker
docker stop resilio-sync

 

I can't get the custom time to work.... o.O

On 5/11/2017 at 6:23 AM, kizer said:

I wrote this script that I tell user.scripts to fire off every morning at 7AM-11AM to back up some stuff from my Mac


#!/bin/bash
#Start Docker
docker start resilio-sync

#Delay before issuing Stop
sleep 4h

#Stop Docker
docker stop resilio-sync

 

 

One could also use the cron expression feature of user.plugins for more customization options.

  • 2 years later...

+1 for this feature request

  • 4 months later...

HI Team, why are you stopping your dockers? When a docker process completes the conainer should stop itself.

 

Also +1 for a scheduled way to start and stop dockers from the interface would be ace!

  • Author
6 hours ago, halogen55 said:

HI Team, why are you stopping your dockers? When a docker process completes the conainer should stop itself.

Some dockers could - and do - run processes 24/7.  If there is no scheduling built into that docker you might not want it running all the time.  For example...

  • You could have something like a Handbrake docker converting all videos in a watched folder to a common format.  Files could go into the watched folder at any time.  This can be system intensive, so you might only want it running overnight when you're not using it for watching movies
  • You might be running Boinc / Folding @ Home - deliberately very processor intensive - and you only want running when you're doing nothing else.  Slightly tenuous, since at least Boinc has its own built-in scheduler
  • You might have torrents - or similar - running, and you don't want to saturate your internet connection during the times you're likely to be needing it (streaming / gaming)
  • There might be something - like a game/media server - that you only want running at certain times of the day for the kids

A few examples, there are perhaps more.  There are dockers I only start when I want to use them, and some that I sometimes put on a schedule.

  • 4 weeks later...

+1 for this feature request

 

Similar use cases to above.

I try to only run the more intensive docker containers during the day (as server is running off solar) 

 

  • 3 weeks later...

+1

  • 2 months later...

+1

  • 4 months later...

+1 on this

  • 2 months later...

+1

+1

  • 3 weeks later...
  • Community Expert

Since I do not know of any specific plans to add this feature to unRaid I have added a section here on what can be done in the meantime to easily set up such a schedule (in the Docker section of the online documentation that can be accessed via the Manual link at the bottom of the unRaid GUI). 

 

I would be interested to know if this is considered sufficient in the short term or more detail is needed?

 

 

  • Author
16 minutes ago, itimpi said:

I would be interested to know if this is considered sufficient in the short term or more detail is needed?

Looks good to me.  Would "docker start <name of container>" work, rather than docker run...?

 

I was thinking of writing a generic user script which ran every 5 minutes (say).  At the top you fill in an array of all the start/stop events you want to happen, each entry having container name, start time and stop time (or array of time ranges).  Then when the script was run it would decide whether it needed to do anything by comparing the current state of a docker against its schedule.  Puts it all into a single script then, but prevents the user from overriding the schedule by manual start/stop.  Parked it until I could think of better logic.

17 minutes ago, Cessquill said:

Would "docker start <name of container>" work, rather than docker run...?

That's how I've always done it.

  • Community Expert
29 minutes ago, jonathanm said:

That's how I've always done it.

 

I'll amend the bit I added to the documentation to mention that you can use 'start' if you have already created the container, and use run if you want to either redownload the container or change a setting.   I think for practical purposes that is the difference?  I perhaps also need to explain how the image name is set up and used?

Archived

This topic is now archived and is closed to further replies.

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.