romancin / tinymediamanager-docker

A repository for creating a docker container including TinyMediaManager with GUI interface.
202 stars 69 forks source link

Execute tmm through cli? #64

Open Alexaalex93 opened 2 years ago

Alexaalex93 commented 2 years ago

Buenos dias, Romancin.

First of all, amazing work with this. I'm trying to create an image of tmm to use it through CLI but, at least for now, I don't know how to do it. How could I modify your image to stop the GUI execution? I cannot run any CLI commands because the databases are used by the GUI. I would like to run tmm in addition another scripts I have and I don't need the GUI anymore.

Thanks for your work and support.

romancin commented 2 years ago

Ok, give me time to think about it to see if I can implement this. It seems a good idea to automate things. Will keep you informed.

goliath888 commented 2 years ago

I was looking for the same and came out with this command:

docker exec tinymediamanager /bin/bash -c "killall -9 java;/config/tinyMediaManagerCMD.sh -updateMovies -scrapeNew -rename"

At first I needed to access to the container, check de PID process of tmm and then kill it..but this was faster and does the job.

@romancin, maybe is it possible to add some variable to avoid staring tmm process at the beggining for use it exclusively with CLI?

Alexaalex93 commented 2 years ago

To make work what I did was to create a container based on ubuntu (ideally would be another lighter) with tmm in it pre-configured. And I start the container mapping the folders what I have the movie and/or series and after that I delete it.

xiNeRoar commented 2 years ago

i found this repository, https://github.com/coolasice1999/tmmcli does this helps? if do, please let us know how it works... thanks

hernandito commented 7 months ago

I know it has been a while... But I did something that may help.

To follow up @goliath888 great advise. I have a script that runs in my Radarr for scraping by TMM. In my script, I have the following lines:

docker exec TinyMM-v3-GUI /bin/bash -c "killall -9 java;/config/tinyMediaManagerCMD.sh -updateMovies -scrapeNew"

The above shuts down the GUI TMM app. The below restarts it:

docker exec TinyMM-v3-GUI /bin/bash /startapp.sh

and the below cleans up that folder TMM creates.

rm -r /mnt/user/Media/Movies/.deletedByTMM/

Please make sure you edit your path's properly. In unRAID, I use my /mnt/cache/Media/Movies as my mapped folder. This way TMM will not scan the entire library and all the scrraped stuff gets moved to the array by mover.

I hope this helps

Thank you @goliath888 and @romancin for all the work and advise.