Script after container start to disable daily refresh

Hello community,
Firstly I want to thank everyone for creating and maintaining the containers, good stuff, cheers! To the point, my movies and series library is quite complete, mostly grabbing newly aired episodes. I want to disable the automated daily movies & episodes refresh tasks, as its not needed daily, not even weekly in my case.
Sonarr/Radarr devs told people multiple times, this switch won’t be added in the UI for users to fiddle with. The remaining option is to change the time in the database itself, which is doable by the script below. The problem comes with the container update/recreate, the value goes back to default and the refresh starts right away taking hour(s) of unnecessary disk reads.

My question is, where would I put the .sh script call, co the container would accept and be happy with it? If I runt the sqlite3 command from containers console it works fine.


echo “fixing refresh…”

sqlite3 /config/radarr.db ‘UPDATE ScheduledTasks SET Interval = 0 WHERE TypeName = “NzbDrone.Core.Movies.Commands.RefreshMovieCommand”;’

by calling this in Portainer in CMD section as /config/ (rights are +x)

Nex container start generates the following logs:
Looking like the script execution kills the container.
,[cont-init.d] executing container initialization scripts…
,[cont-init.d] 01-envfile: executing…
,[cont-init.d] 01-envfile: exited 0.
,[cont-init.d] 10-adduser: executing…
, _ ()
, | | ___ _ __
, | | / | | | / \
, | | _
\ | | | () |
, || |
/ || __/
,Brought to you by
,We gratefully accept donations at:
,User uid: 1000
,User gid: 1000
,[cont-init.d] 10-adduser: exited 0.
,[cont-init.d] 30-config: executing…
,[cont-init.d] 30-config: exited 0.
,[cont-init.d] 90-warning: executing…
,[cont-init.d] 90-warning: exited 0.
,[cont-init.d] 99-custom-scripts: executing…
,[custom-init] no custom files found exiting…
,[cont-init.d] 99-custom-scripts: exited 0.
,[cont-init.d] done.
,[services.d] starting services
,[services.d] done.
,fixing refresh…
,[cmd] /config/ exited 0
,[cont-finish.d] executing container finish scripts…
,[cont-finish.d] done.
,[s6-finish] waiting for services.
,[s6-finish] sending all processes the TERM signal.

Do you have any suggestions about how to overcome while still using the off-the-rack container? Im sure its something silly I’m missing.
Thanks in advance.

See here:

Excellent, thank you, this is it! that’s what I was missing. Thank you Thank you.

For ppl after me, this is the script. I had to put bit of delay, because was executed too soon, and radarr init reverted the changes back to default.

create custom-cont-init.d in your radarr folder and add the into it

#!/bin/bash echo "fixing refresh..." sleep 10 && sqlite3 /config/radarr.db 'UPDATE ScheduledTasks SET Interval = 0 WHERE TypeName = "NzbDrone.Core.Movies.Commands.RefreshMovieCommand";' &

notice the & at the end, this will make your command run in the background.