Automatic scraping library daily
#1
Hey guys,

I'm currently running TMM in a docker image. I would like to be able to automate the library update and scraping. For this I have a cron job calling following script:
Quote:#!/bin/bash
docker exec tinymediamanager /tinyMediaManager/tinyMediaManagerCMD.sh -update -scrapeNew

My problem now is that I'm getting an error unless I'm closing the web GUI of TMM, but then I can't use the web to check the status, new movies etc.
Quote:ERROR [headless] o.t.core.movie.MovieModuleManager:94 - Error in the background thread of the persistent cache
java.lang.IllegalStateException: The file is locked: nio:data/movies.db [1.4.191/7]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:773)
Is there a way to fix that? I don't want to run TMM manually every day.

thanks a lot.
#2
Not easily.
The GUI opens the database, the CMD tries also.
This failed, because the files is locked for the GUI.

But this is a common way in all operating systems.
When a file has been opened, it is "locked" and you cannot (easily) modify or delete it.
Which does make sense...

Yes, i see your problem with the remote docker TMM, but have no solution in mind...
tinyMediaManager - THE media manager of your choice :)
Wanna help translate TMM ?
Image
#3
Hey myron,
thank you for taking the time to answer my question.
Do you think it will be possible to add a feature in future versions to set an automatic refresh and scrape in the GUI?

If there is no immediate solution possible maybe I can get the script to kill and restart the GUI as well.

Thanks a lot.
#4
Not to trying to be an ass but can't you close the app when you're not using it?

I only use the gui if I don't like what it scraped for images and / or when CMD can't find the movie / show for some unexplained reason when the GUI can.  Otherwise, I have the automatic run executed every hour.  That seems to be good enough.
#5
(2019-02-13, 15:59)andyd Wrote: Not to trying to be an ass but can't you close the app when you're not using it?

I only use the gui if I don't like what it scraped for images and / or when CMD can't find the movie / show for some unexplained reason when the GUI can.  Otherwise, I have the automatic run executed every hour.  That seems to be good enough.

Hey andyd...

This would be great for me: "I have the automatic run executed every hour". I didn't know tMM was capable of doing this. Could you point me to the right documentation for implementing this... or a quick example for Windows 10...

Thanks in advance...
#6
(2019-02-09, 06:02)mrgoodkat Wrote: Hey guys,

I'm currently running TMM in a docker image. I would like to be able to automate the library update and scraping. For this I have a cron job calling following script:
Quote:#!/bin/bash
docker exec tinymediamanager /tinyMediaManager/tinyMediaManagerCMD.sh -update -scrapeNew

My problem now is that I'm getting an error unless I'm closing the web GUI of TMM, but then I can't use the web to check the status, new movies etc.
Quote:ERROR [headless] o.t.core.movie.MovieModuleManager:94 - Error in the background thread of the persistent cache
java.lang.IllegalStateException: The file is locked: nio:data/movies.db [1.4.191/7]
at org.h2.mvstore.DataUtils.newIllegalStateException(DataUtils.java:773)
Is there a way to fix that? I don't want to run TMM manually every day.

thanks a lot.  
Thought I would share my solution for this, though it may not suit everyone's needs. Since the GUI is what has the lock on the db file, I simple tell the container to kill the java process before running the update, and then restart the GUI after that is complete. This can be done with an exec from outside of the container, and called by cron. It makes the UI unusable while stopped, but I only run this nightly, and may be annoying if you're running it hourly. Hope this helps.

Logout Mark Read Team Forum Stats Members Help
Automatic scraping library daily0