05-23-2010, 04:05 AM | #1 |
Member
Posts: 23
Karma: 10
Join Date: May 2010
Device: none
|
Keeping book on NAS but metadata.db on local (Ubuntu)
I've installed Calibre latest (0.6.54) version under Ubuntu Lucid (10.04) and it works fine.
The only problem I have is that when I tried to move my e-book directory location from local hard drive to NAS ( which is mounted as -t cifs ) , calibre reported problems. I did a search on the web and found out that other people experienced this problem as well and the reason is the sqlite3 can't work with NAS. I've tried (instead of moving e-book directory via preferences) to cheat namely, I manually copied Calibre Library to NAS, then deleted directory Calibre Library from local harddrive and created the symbolic link to NAS directory with the same name. This doesn't work either. I was wondering if somebody know the way to bypass this, is it possible to keep metadata.db on local hard drive but book themselves on NAS ? |
05-23-2010, 05:04 AM | #2 |
Guru
Posts: 695
Karma: 822675
Join Date: May 2010
Device: Kobo Aura, Nokia Lumia 920 (Freda)
|
Set an environment variable named CALIBRE_OVERRIDE_DATABASE_PATH to a local path for your metadata.db file, and leave the library location in Preferences set to your NAS share. Calibre looks for that environment variable (and many others) to override default behavior.
I've had my database and library separated for some time now, for similar reasons to yours (I use a WHS rather than a NAS, though I do keep my metadata.db file on the WHS just in a separate location). |
Advert | |
|
05-23-2010, 05:34 AM | #3 |
Wizard
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
Calibre allows you to control the placement of all its files by a combination of settings in Environment Variables and command line parameters.
Attached is the batch file I use for this in Windows. It is easy enough to see how it works and should be simple to adapt the syntax to other OS such as Linux or Mac OS. It can also be used to run calibre off a USB stick or other portable media. |
05-23-2010, 02:17 PM | #4 |
Member
Posts: 23
Karma: 10
Join Date: May 2010
Device: none
|
Thanks lot, works like a charm ( I wish this option will be in Preferences )
Toddos, Itimpi !
Thanks a lot ! Toddos, a single setenv, as you recommended, solved all the problems. Itimpi, I appreciate you sent me the bat file. I can easily modify it to work as a shell script in Ubuntu (also will be very useful if I need to run calibre under Windows ) I only wish the option of setting separate paths for Library and Metadata were in the Preferences (may be under Advanced), since as I mentioned, quite a few people reported this problem. At the very least, I would put the short note with warning and instructions in FAQ on calibre website and/or manual Last edited by q345; 05-23-2010 at 09:27 PM. |
05-23-2010, 08:20 PM | #5 | |
US Navy, Retired
Posts: 9,865
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
|
|
Advert | |
|
05-23-2010, 09:25 PM | #6 |
Member
Posts: 23
Karma: 10
Join Date: May 2010
Device: none
|
I will ( "rotating snakes" are cool BTW )
Is it any other way to discover all the environment variables, other then downloading the sources and search for "os.environ.get" string in the source tree ?
I didn't find any document, but the names are mostly self-explanatory Last edited by q345; 05-23-2010 at 09:28 PM. |
05-24-2010, 12:53 AM | #7 |
Member
Posts: 23
Karma: 10
Join Date: May 2010
Device: none
|
Enhancement ticket #5600 has just been opened
http://bugs.calibre-ebook.com/ticket/5600
Enable separate directories for metadate.db and ebooks library in Preferences Menu |
05-24-2010, 05:48 PM | #8 |
Member
Posts: 23
Karma: 10
Join Date: May 2010
Device: none
|
Update : #5600 closed - resolution: wont' fix
The ticket has been closed with explanation that this is not a recommended procedure, so it will not be exposed in Preferences menu.
May be there is an additional headache to support or there are some side effects to it, who knows. Anyway, a single setenv in .gnomerc has enabled it and it works fine ever since |
05-25-2010, 02:42 AM | #9 | |
Wizard
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
Quote:
I would like to see the full list of environment variables and command line options used by calibre in this area added to the documentation for future reference. |
|
05-25-2010, 04:16 AM | #10 |
Member
Posts: 23
Karma: 10
Join Date: May 2010
Device: none
|
advanced features
If it's only a safeguard against naive users, tt can always be added to advanced features with proper warning/disclaimer BTW, even if it's in a normal mode and an uneducated user starts playing with Calibre Library directory, he/she easily can get into all kind of troubles, even without NAS, so I wonder if it's the only reason.
I wish the ticket would be given a little bit more explanation, why it's not recommended ( it was just a single sentence ), for instance is there any negative side effects on the long run, but after all it's a free software and we all should thank the developer since he is clearly doing us a huge favor by developing and supporting it. Regarding environmental variables in general, may be it's too much to ask. I grepped source directory for os.environ.get method and there is not a lot of them, but writing a manual, especially describing the combinations of them might take too much time. I thought this particular option is reasonable to expose, since NASes are mainstream now and installation is so easy that even "dumb" users now purchase them but it's my private opinion of course |
05-25-2010, 04:34 AM | #11 | |
Guru
Posts: 695
Karma: 822675
Join Date: May 2010
Device: Kobo Aura, Nokia Lumia 920 (Freda)
|
Quote:
So contribute to the project by writing a manual? |
|
05-25-2010, 11:34 AM | #12 |
creator of calibre
Posts: 44,264
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The reason is simple, this kind of customization is fragile. The calibre codebase is not designed to support it and things can break. If you are careful and lucky enough, they wont break, but this is very much a you broke the warranty kind of deal.
Furthermore, I am not willing to guarantee that this technique will always be available in the future. Which becomes implied if I add it to the preferences. |
05-25-2010, 12:15 PM | #13 | |
Well trained by Cats
Posts: 30,280
Karma: 57979022
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Glitch that and things get broken. Calibre appears to be a hybrid of the O/S file system (author and title folders) and a database to keep track of said contents (along with other stuff). Queuing files to get written to a networked device and having a local (faster), database is asking for one to get updated without the other completing Suppose the mount point gets confused? Kovid kept the Metadata DB in the same path as the books for a good reason They are a mated pair. It is your foot to shoot off. :/ You can store Gasoline near a water heater, without it ALWAYS catching fire. . . That does not make it a good idea. |
|
05-25-2010, 12:31 PM | #14 |
Wizard
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
Actually if you are going to run off a NAS it is probably MORE reliable to have the database locally. File level operations (open/close/rename/copy etc) across the network tend to be extremely reliable, whereas SQLite database updates are fragile and low performance.
The biggest issue with having the database locally is likely to be user error when using Calibre on multiple machines with not always working off the latest metadata database. I reduce the likelihood of that happening by having an automatic sync of the metadata database back to the NAS whenever Calibre is closed down. I am also the only person updating my Calibre library so am not subject to someone attempting to make changes asynchronously to me. |
05-25-2010, 01:28 PM | #15 |
Member
Posts: 23
Karma: 10
Join Date: May 2010
Device: none
|
Reliability
There is a digital music player box called Squeezebox from Logitech which I have had for 5 years. The server maintains database of one's digital music (they used sqlite and also mysql). I have never had any problem for 5 years having my mp3 files on NAS. Tens of thousend of peoples maintains they collections on NAses while having database file localy, I don't recall somebody complained. ( It's an official option not a hack )
I don't know if it's a factor, but in case of Logitech Squeezebox, files are not physically get copied, which is a major differences, of course. Many other similar devices applications like amarok music player on Ubuntu, Media Monkey on Windows uses the same approach. They all have an option 'rebuild database' which scan the directory and rebuild database and those applications are by no means intended for geeks. May be Calibre should have a similar option - rebuild database, which scan Calibre Library directory and generate metadata.db as a result. Cost of database inconsistency will be just few minutes. Last edited by q345; 05-25-2010 at 01:33 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre hangs on startup after moving to NAS | smartin | Calibre | 4 | 09-26-2010 04:21 PM |
Metadata and book covers | Magic Man | Calibre | 3 | 09-05-2010 06:20 AM |
Seriously thoughtful Anyone have any experience of NAS devices? | HarryT | Lounge | 9 | 12-10-2009 04:50 AM |
Library on NAS server? | bous | Calibre | 5 | 11-26-2009 05:03 AM |
software for book keeping ? | mgph | Sony Reader | 8 | 06-06-2009 09:55 PM |