Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 04-28-2013, 01:17 AM   #1
cptnemo
Enthusiast
cptnemo began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Oct 2011
Device: Kindle 3
Sync library between server and laptop

Hello,

I have a Raspberry Pi running a headless calibre (0.8.51) and a MacBook running also calibre. My idea is to keep the two libraries in sync so if I add a book on one computer I will also be able to access it from the second.

Now, I am trying to define a strategy to avoid troubles.

I know that if I try to sync one library while the very same library is also being used by calibre I can corrupt the database. But then, calibre on the raspberry is always on (I use it to download recipes). If I make sure that calibre on the raspberry is adding books only when no sync is going on (that is, calibre is running but not accessing the library), do I still risk to corrupt the database? Should I then make sure that when I sync both calibre are off?

Also, the fact that calibre on the Raspberry is a much older version than calibre on the mac could create compatibility issue while accessing the same library?


Thanks
cptnemo is offline   Reply With Quote
Old 04-28-2013, 05:59 PM   #2
cptnemo
Enthusiast
cptnemo began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Oct 2011
Device: Kindle 3
I will answer my own question.

The strategy seems to work. By syncing the library folders I manage to access the same library from both. I use unison to sync. After every synchronisation I need to restart calibre on the server.
cptnemo is offline   Reply With Quote
Advert
Old 04-29-2013, 01:13 AM   #3
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
One trick is to use a "buffer copy" of the library. Then you don't have to turn calibre off on both the laptop and the Pi. Instead you write changes to the buffer copy, and on restart sync with that buffer copy. The buffer should be on a network share that is always available for both the laptop and the Pi.

Also you have to decide the direction of the changes. Typically I assume that you add news on the Pi, and add books and update metadata on the laptop?

This can be managed by having two calibre libraries and two buffer copies. One for news, Pi->buffer1->Laptop, and one for actual books, Laptop->buffer2->Pi.

You can sync to buffer automatically when you shut down calibre by adding steps to the script that launch calibre, after calibre has been run in the script. You can sync from the buffer by adding steps to the script before calibre is run.
Adoby is offline   Reply With Quote
Old 05-04-2013, 09:29 PM   #4
cptnemo
Enthusiast
cptnemo began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Oct 2011
Device: Kindle 3
Quote:
Originally Posted by Adoby View Post
One trick is to use a "buffer copy" of the library. Then you don't have to turn calibre off on both the laptop and the Pi. Instead you write changes to the buffer copy, and on restart sync with that buffer copy. The buffer should be on a network share that is always available for both the laptop and the Pi.

Also you have to decide the direction of the changes. Typically I assume that you add news on the Pi, and add books and update metadata on the laptop?

This can be managed by having two calibre libraries and two buffer copies. One for news, Pi->buffer1->Laptop, and one for actual books, Laptop->buffer2->Pi.

You can sync to buffer automatically when you shut down calibre by adding steps to the script that launch calibre, after calibre has been run in the script. You can sync from the buffer by adding steps to the script before calibre is run.
That's interesting. Have you direct experience with it? Do you think this will create less conflicts than sync directly the two libraries? One problem I see in this is that at the end of the day you mantain 4 libraries instead of 2.
cptnemo is offline   Reply With Quote
Old 05-05-2013, 02:33 AM   #5
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
As I see it you still only maintain your original library/libraries, exactly as usual, but now you also have a backup copy.

I use this procedure, an intermediary copy, to send books to my device and to make backups of the entire calibre library.

I have a folder on my NAS that is a copy of the book folders on my device. I connect to this folder from Calibre and send updates and changes there.

My device automatically sync from this folder using the app FolderSync every hour, but only if charging, or if manually launched.

Also when I quit calibre a backup copy of the calibre library is automatically updated using rsync. This backup copy is then daily backuped using "Time Vault" style backup to external USB harddrive. The backup is also used to automatically refresh the library used by a VM, every time the VM is started. I sometimes use the VM to run the calibre content server.

I use the intermediary buffer to avoid having to turn things on and off at both ends, before I can send/backup.

I only have one "main" instance of calibre, that is where I add books and update metadata and so on. I don't fetch news.

Last edited by Adoby; 05-05-2013 at 02:48 AM.
Adoby is offline   Reply With Quote
Advert
Reply

Tags
calibre


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
moving Calibre library to a new laptop. How??? Caseyknox Library Management 2 01-04-2013 05:50 AM
How to copy library from desktop to laptop? PatGIV Library Management 13 11-24-2012 06:43 PM
Can't add books to calibre library on friends laptop 20LEgend Library Management 0 06-16-2012 03:12 PM
Transferring library to new laptop Lynda Benham Library Management 1 08-23-2011 05:26 PM
Moving library to new laptop qprfan99 Library Management 10 05-27-2011 05:27 PM


All times are GMT -4. The time now is 07:18 PM.


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