Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-26-2009, 01:08 PM   #1
rootto
Junior Member
rootto began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Sep 2009
Device: none
sqlite samba lock

Hi,

I'm tying to use calibre (0.4.143) using a samba share, but I receive an error from sqlite. I read that sqlite has problem with network shares: is there any way to keep all the *.db in my home directory and use the samba share only to store the library. I've modified the property database_path in the file .config/globay.py in order to point to my home directory. The library1.db is not created, instead the file metadata.db is created in the library directory (if I specify a local directory the file is populated with the db, if I use the share the file has only an 'S'). Any idea on how to solve the problem?

Thanks

Nicola
rootto is offline   Reply With Quote
Old 09-26-2009, 01:54 PM   #2
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,094
Karma: 780247
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Yes - you can have tight control over where aoll the Caliber files are located using a combination of Environment Variables and runtime switches. I use the following batch file on Windows:
Quote:
@echo OFF
REM Batch File to start a Calibre configuration on Windows
REM giving explicit control of the location of:
REM - Calibe Program Files
REM - Calibre Library Files
REM - Calibre Config Files
REM - Calibre Metadata database
REM By setting the paths correctly it can be used to run:
REM - A "portable calibre" off a USB stick.
REM - A network installation with local metadata database
REM (for performance) and books stored on a network share

CD CalibreConfig
SET CALIBRE_CONFIG_DIRECTORY=%cd%
CD ..
CD CalibreLibrary
rem SET CALIBRE_LIBRARY_DIRECTORY=%cd%
SET CALIBRE_LIBRARY_DIRECTORY=U:\eBooks\CalibreLibrary
CD ..
CD Calibre
SET CALIBRE_OVERRIDE_DATABASE_PATH=P:\CalibreLibrary\m etadata.db

echo CD=%cd%
echo CONFIG=%CALIBRE_CONFIG_DIRECTORY%
echo LIBRARY=%CALIBRE_LIBRARY_DIRECTORY%
echo DATABASE=%CALIBRE_OVERRIDE_DATABASE_PATH%
pause

START /belownormal Calibre --with-library %CALIBRE_LIBRARY_DIRECTORY%
This setup is running with a network share for the book files (U and a local (P metadata.db file. You will note I also specify where the Calibre Config information and Program Files are located as I do not use default locations for either. The other point is starting Calibre at BelowNormal priority as this keeps my system responsive without affecting Calibre performance significantly. You should be able to amend it to suit your particular requirements.

If you are not using Windows it should be easy enough to translate it to the equivalent on your system.

Last edited by itimpi; 09-26-2009 at 02:00 PM.
itimpi is offline   Reply With Quote
 
Advertisement
Old 09-27-2009, 09:03 AM   #3
rootto
Junior Member
rootto began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Sep 2009
Device: none
Thanks for your script. I forgot to say that I'm running ubuntu. This is the converted script:

Code:
#!/bin/dash

# Batch File to start a Calibre configuration on Windows
# giving explicit control of the location of:
# - Calibe Program Files
# - Calibre Library Files
# - Calibre Config Files
# - Calibre Metadata database
# By setting the paths correctly it can be used to run:
# - A "portable calibre" off a USB stick.
# - A network installation with local metadata database
# (for performance) and books stored on a network share

CalibreConfig=/home/`whoami`/.config/calibre
LIBRARY_DIR='/media/Nicola/Ebooks/'

export CALIBRE_CONFIG_DIRECTORY=$CalibreConfig
export CALIBRE_LIBRARY_DIRECTORY=$LIBRARY_DIR
export CALIBRE_OVERRIDE_DATABASE_PATH=$CalibreConfig'/metadata.db'

echo CONFIG=$CALIBRE_CONFIG_DIRECTORY
echo LIBRARY=$CALIBRE_LIBRARY_DIRECTORY
echo DATABASE=$CALIBRE_OVERRIDE_DATABASE_PATH

calibre --with-library $LIBRARY_DIR
but it doesn't work. I guess calibre it's not reading the evn variables.
The way I solved is to mount the share using the nobrl option:

Code:
mount -t cifs -o nobrl  //192.168.1.70/Nicola /media/Nicola
In this way the lock is not propagated to the server.
rootto is offline   Reply With Quote
Old 09-27-2009, 03:00 PM   #4
rootto
Junior Member
rootto began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Sep 2009
Device: none
I tried the script with a new version of calibre (0.6.13) and the script works, so there is no need to specify the noblr option. I changed the script in order to be able to share the same DB with different computers (no concurrent access, but hey!)

Code:
#!/bin/dash

# Batch File to start a Calibre configuration on Windows
# giving explicit control of the location of:
# - Calibe Program Files
# - Calibre Library Files
# - Calibre Config Files
# - Calibre Metadata database
# By setting the paths correctly it can be used to run:
# - A "portable calibre" off a USB stick.
# - A network installation with local metadata database
# (for performance) and books stored on a network share

CalibreConfig=/home/`whoami`/.config/calibre
LIBRARY_DIR='/media/Nicola/Ebooks/'

export CALIBRE_CONFIG_DIRECTORY=$CalibreConfig
export CALIBRE_LIBRARY_DIRECTORY=$LIBRARY_DIR
export CALIBRE_OVERRIDE_DATABASE_PATH=$CalibreConfig'/metadata.db'

echo CONFIG=$CALIBRE_CONFIG_DIRECTORY
echo LIBRARY=$CALIBRE_LIBRARY_DIRECTORY
echo DATABASE=$CALIBRE_OVERRIDE_DATABASE_PATH

cp $LIBRARY_DIR'/metadata.db' $CalibreConfig
calibre --with-library $LIBRARY_DIR
cp $CalibreConfig'/metadata.db'  $LIBRARY_DIR'/metadata.db'
rootto is offline   Reply With Quote
Old 09-27-2009, 03:03 PM   #5
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,094
Karma: 780247
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
I had not spotted that you were using such an old version of Calibre. Most of the options in the script have been introduced quite recently - in fact the one to specify the location of the metadata.db file was new in 0.6.13.
itimpi is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kobo sqlite database darkadept Kobo Reader 38 09-08-2013 09:12 PM
Sqlite database replacement instructions pholy Kobo Reader 62 10-11-2012 10:19 AM
Koboreader.sqlite gundged maxwelledison Kobo Reader 21 01-12-2011 09:24 AM
Kobo Database Browser - SQLite JBlyth Kobo Reader 2 06-06-2010 10:27 PM
iLiad Samba/smbd/shared folder access to iLiad ajnorth iRex Developer's Corner 12 02-29-2008 10:02 AM


All times are GMT -4. The time now is 09:56 PM.


MobileRead.com is a privately owned, operated and funded community.