Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Calibre Specific Environment Variables #8

Closed
HaydoZV2 opened this issue Sep 19, 2019 · 14 comments · Fixed by #22
Closed

Use Calibre Specific Environment Variables #8

HaydoZV2 opened this issue Sep 19, 2019 · 14 comments · Fixed by #22
Assignees

Comments

@HaydoZV2
Copy link

Is it possible to use the calibre environment variables to have the calibre metadata.db in a folder separate to the book storage.

I've tried adding this as a docker environment option with no success.

@project-bot project-bot bot added this to To do in Issue & PR Tracker Sep 19, 2019
@aptalca
Copy link
Member

aptalca commented Sep 19, 2019

I don't think it does what you think it does.

It just lets you specify the config folder location while starting Calibre, as opposed to setting it in the gui after first start.

@HaydoZV2
Copy link
Author

Specifically I'm talking about:

CALIBRE_OVERRIDE_DATABASE_PATH - allows you to specify the full path to metadata.db. Using this variable you can have metadata.db be in a location other than the library folder. Useful if your library folder is on a networked drive that does not support file locking.

As my library is on a network drive that doesn't play well with file locking.

@aptalca
Copy link
Member

aptalca commented Sep 19, 2019

Gotcha. I'll look into it.

@aptalca aptalca self-assigned this Sep 19, 2019
@aptalca
Copy link
Member

aptalca commented Sep 19, 2019

Try this:

  1. map a new local folder in docker run/create with -v /path/to/local/folder/:/db
  2. Copy the database file to that folder on host
  3. Set environment variable in docker run/create with -e CALIBRE_OVERRIDE_DATABASE_PATH=/db/metadata.db

@HaydoZV2
Copy link
Author

This seems to work if I let the docker install create a new database and then move it.

If I copy my existing calibre database to the override path it reports a corrupted database (can't implement the file lock) and tries to create a new metadata.db in the networked library location.

However, the previous install has carried across operating systems so this may also be interfering. I may have to recreate the database.

@aptalca
Copy link
Member

aptalca commented Sep 20, 2019

I have not tested moving database across OSes

@aptalca aptalca closed this as completed Oct 24, 2019
Issue & PR Tracker automation moved this from To do to Done Oct 24, 2019
@hex2a
Copy link

hex2a commented Dec 9, 2019

setting calibre variables (CALIBRE_OVERRIDE_DATABASE_PATH) as docker env variables did not work for me, seems they are not passed to calibre, manually specifying them with s6-env in the services file worked.

@timmehtimtims
Copy link

timmehtimtims commented Jan 9, 2020

@hex2a - Hi mate, could you elaborate on this a little? I'm a bit of a noob and backing up my system tonight with a view to trying this out tomorrow. I'm currently using docker on Ubuntu and will be moving my libraries from local storage to GDrive (loads of comics).

From what you're saying it's better to specify the env. override in the services file. I've been reading a bit online and it's not immediately clear.
Is it as easy as nano /etc/environment and then adding CALIBRE_OVERRIDE_DATABASE_PATH=db/metadata.db? Or is there a little more to it?

@RX4NT9UP
Copy link

RX4NT9UP commented Feb 19, 2020

Passing -e CALIBRE_OVERRIDE_DATABASE_PATH=/config/metadata.db didn't work for me either. For some reason it's not being picked up.

@MEGAMENE
Copy link

MEGAMENE commented Mar 1, 2020

It's also not working for me, does anyone have any ideas?

@undaunt
Copy link

undaunt commented Mar 10, 2020

Just asking regarding the above - would I be able to modify a local copy of the docker to support this prior to it possibly being pulled into a future master? If so, how could I do this? It's a showstopper for me right now due to mergerfs/gsuite causing Calibre to regenerate an empty metadata.db on the local filesystem after each restart of the container.

Thanks!

@aptalca aptalca reopened this Mar 18, 2020
@aptalca
Copy link
Member

aptalca commented Mar 18, 2020

Sorry, I'm a little thick, and I just saw hurricane's posts. Yup, calibre is missing the with-contenv in its service file. I'll go ahead and add it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

8 participants