Cessquill Posted January 15, 2017 Share Posted January 15, 2017 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. 4 Quote Link to comment
Squid Posted January 15, 2017 Share Posted January 15, 2017 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 2 Quote Link to comment
Cessquill Posted January 15, 2017 Author Share Posted January 15, 2017 Thank you - off to play with that now Quote Link to comment
1812 Posted May 11, 2017 Share Posted May 11, 2017 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! Quote Link to comment
kizer Posted May 11, 2017 Share Posted May 11, 2017 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 2 1 Quote Link to comment
1812 Posted May 11, 2017 Share Posted May 11, 2017 I can't get the custom time to work.... Quote Link to comment
thomast_88 Posted May 13, 2017 Share Posted May 13, 2017 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. Quote Link to comment
imthian Posted November 15, 2019 Share Posted November 15, 2019 +1 for this feature request Quote Link to comment
halogen55 Posted April 2, 2020 Share Posted April 2, 2020 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! Quote Link to comment
Cessquill Posted April 2, 2020 Author Share Posted April 2, 2020 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. Quote Link to comment
LynxNZ Posted April 27, 2020 Share Posted April 27, 2020 +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) Quote Link to comment
itimpi Posted April 22, 2021 Share Posted April 22, 2021 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? 1 Quote Link to comment
Cessquill Posted April 22, 2021 Author Share Posted April 22, 2021 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. Quote Link to comment
JonathanM Posted April 22, 2021 Share Posted April 22, 2021 17 minutes ago, Cessquill said: Would "docker start <name of container>" work, rather than docker run...? That's how I've always done it. Quote Link to comment
itimpi Posted April 22, 2021 Share Posted April 22, 2021 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? 1 Quote Link to comment
Recommended Posts
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.