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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 07-29-2024, 06:32 PM   #16
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,655
Karma: 74500000
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Why not use the sleep command to wait for a predetermined time period rather than a while loop?
PeterT is offline   Reply With Quote
Old 07-30-2024, 10:03 AM   #17
ratinox
Fanatic
ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.
 
Posts: 562
Karma: 5613032
Join Date: Oct 2016
Location: Somewhere in Time
Device: Forma, iPad Air 4
Quote:
Originally Posted by sheepdog View Post
Code:
...
sleep 15
...
instead of your for loops.

Oh. PeterT made the same suggestion. Though there probably is (or should be) a better way to query the Dropbox software directly instead of waiting some arbitary time. You might also consider using rclone which is similar to rsync but for cloud storage services like Dropbox and OneDrive. I have used rclone for replication against OneDrive. It worked.
ratinox is offline   Reply With Quote
Advert
Old 07-30-2024, 11:04 AM   #18
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,075
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Sirtel View Post
I'm pretty sure those who want to do it are going to do it anyway.
But at least they've been warned if they read this thread.
JSWolf is offline   Reply With Quote
Old 07-30-2024, 11:07 AM   #19
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,075
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by sheepdog View Post
I certainly agree, that you cannot depend upon Dropbox alone, and you need to backup and check the libraries often. That said, here is a simple-minded script that works on my linux machine to do what was suggested:

Code:
deleted the code as I don't want to help anyone corrupt their library
Please make a new script that will use rsync to sync from your active library to your dropbox directory to be able to sync your library without risk of your active library becoming corrupt.

Also, please delete your existing script or others will use it and corrupt their library.
JSWolf is offline   Reply With Quote
Old 07-31-2024, 09:21 AM   #20
ratinox
Fanatic
ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.
 
Posts: 562
Karma: 5613032
Join Date: Oct 2016
Location: Somewhere in Time
Device: Forma, iPad Air 4
Quote:
Originally Posted by JSWolf View Post
Please make a new script that will use rsync to sync from your active library to your dropbox directory to be able to sync your library without risk of your active library becoming corrupt.
rclone is the superior tool. It is designed specifically to work with cloud storage providers like Dropbox and OneDrive.
ratinox is offline   Reply With Quote
Advert
Old 07-31-2024, 10:18 AM   #21
sheepdog
Member
sheepdog began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jul 2024
Device: calibre
Yes, corrected script follows:
Code:
#!/bin/bash

dropbox start
dropbox status
echo -n "SYNCING CALIBRE"
wait_time=15
i=0
while [ $i -le $wait_time ]; do
	sleep 1
	echo -n .
	((i++))
done
dropbox stop
echo -n "STOPPING DROPBOX"
i=0
while [ $i -le $wait_time ]; do
	sleep 1
	echo -n .
	((i++))
done
calibre 
echo - n "SYNCING DROPBOX"
i=0
while [ $i -le $wait_time ]; do
	sleep 1
	echo -n .
	((i++))
done
dropbox start
dropbox status
i=0
while [ $i -le $wait_time ]; do
	sleep 1
	echo -n .
	((i++))
done
dropbox stop
The Dropbox does not appear to have a method for querying the sync state. So the script uses an arbitrary wait time.

Last edited by sheepdog; 07-31-2024 at 10:21 AM. Reason: Adding information.
sheepdog is offline   Reply With Quote
Old 07-31-2024, 11:50 AM   #22
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,655
Karma: 74500000
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Umm.. why not replace
Code:
i=0
while [ $i -le $wait_time ]; do
	sleep 1
	echo -n .
	((i++))
done
by
Code:
sleep $wait_time
Sure you won't get a snazzy dot being displayed every second but....
PeterT is offline   Reply With Quote
Old 07-31-2024, 11:58 AM   #23
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 76,075
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by ratinox View Post
rclone is the superior tool. It is designed specifically to work with cloud storage providers like Dropbox and OneDrive.
Does rclone do a one way sync to Dropbox and/or OneDrive?
JSWolf is offline   Reply With Quote
Old 07-31-2024, 12:25 PM   #24
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,655
Karma: 74500000
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Quote:
Originally Posted by JSWolf View Post
Does rclone do a one way sync to Dropbox and/or OneDrive?
From the documentation
Quote:
rclone sync
Make source and dest identical, modifying destination only.
and yes, it supports DropBox and OneDrive
PeterT is offline   Reply With Quote
Old 07-31-2024, 12:26 PM   #25
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,655
Karma: 74500000
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Quote:
Originally Posted by ratinox View Post
rclone is the superior tool. It is designed specifically to work with cloud storage providers like Dropbox and OneDrive.
Thanks for suggesting rclone. It's allowed me easy data backup from my pikapod app to local storage.
PeterT is offline   Reply With Quote
Old 07-31-2024, 04:00 PM   #26
sheepdog
Member
sheepdog began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jul 2024
Device: calibre
The key to using Dropbox with Calibre is to realize that, so long as Calibre and the Dropbox daemon are never running at the same time, the risk of corruption is no greater than with one or the other alone. That said, be aware that Calibre is still running even when the main window is closed if there is a viewer window open. I could not find an option in Calibre to close the viewer windows automatically whenever the main window is closed. So to use Dropbox you need to be sure to close all Calibre viewer windows and the main window before running the Dropbox daemon. I have scripted this condition in linux as well, for myself. The code will be very system dependent, so not including it here.
sheepdog is offline   Reply With Quote
Old 07-31-2024, 07:20 PM   #27
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,959
Karma: 27620690
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by sheepdog View Post
The key to using Dropbox with Calibre is to realize that, so long as Calibre and the Dropbox daemon are never running at the same time, the risk of corruption is no greater than with one or the other alone. . . .
be aware that Calibre is still running even when the main window is closed if there is a viewer window open.

I could not find an option in Calibre to close the viewer windows automatically whenever the main window is closed.
FYI: The viewer and the editor run as separate processes, and they can open files directly - i.e not via the library manager and not necessarily within a calibre library.

I don't know of any easy way to determine if a folder (e.g. a calibre library) or it's contents are in use.

BR
BetterRed is online now   Reply With Quote
Old 07-31-2024, 09:19 PM   #28
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,655
Karma: 74500000
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Quote:
Originally Posted by BetterRed View Post
I don't know of any easy way to determine if a folder (e.g. a calibre library) or it's contents are in use.

BR
Check out the SysInternals command handle; it might help --> https://learn.microsoft.com/en-ca/sy...wnloads/handle
PeterT is offline   Reply With Quote
Old 08-01-2024, 10:00 AM   #29
ratinox
Fanatic
ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.
 
Posts: 562
Karma: 5613032
Join Date: Oct 2016
Location: Somewhere in Time
Device: Forma, iPad Air 4
Quote:
Originally Posted by PeterT View Post
Check out the SysInternals command handle; it might help --> https://learn.microsoft.com/en-ca/sy...wnloads/handle
And the lsof command on Linux and some Unix.
ratinox is offline   Reply With Quote
Old 08-01-2024, 10:26 AM   #30
ratinox
Fanatic
ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.ratinox ought to be getting tired of karma fortunes by now.
 
Posts: 562
Karma: 5613032
Join Date: Oct 2016
Location: Somewhere in Time
Device: Forma, iPad Air 4
Quote:
Originally Posted by sheepdog View Post
The key to using Dropbox with Calibre is to realize that, so long as Calibre and the Dropbox daemon are never running at the same time, the risk of corruption is no greater than with one or the other alone.
This is not entirely accurate.

Leaving aside Dropbox in particular, the root problem is that multiple instances of an open database file on replicated or shared storage will result in corruption. Instance 1 writes, replication system replicates, but Instance 2 does not know that the file is changed so it writes and damages the file. This damage is replicated back to Instance 1's filesystem but Instance 1 does not know of these changes so it writes and causes further damage. The more times this happens, the more damage is done.

Dropbox in particular may have additional problems. I don't use it so I don't know. I do use Syncthing, being careful to avoid Calibre concurrency, and it has been fine for many years.
ratinox 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
Using Calibre on multiple computers Waitingforatrain Library Management 2 09-19-2016 07:12 PM
calibre and multiple computers aielloj Calibre 4 06-26-2011 02:10 AM
How to Duplicate My Calibre Library on Multiple Computers? Sydney's Mom Related Tools 101 03-10-2011 12:14 PM
Using one Calibre Library (via Dropbox) on Multiple Computers PocketGoddess Related Tools 14 02-20-2011 04:15 AM
Multiple computers and Calibre starrigger Calibre 11 03-19-2009 12:14 PM


All times are GMT -4. The time now is 08:30 PM.


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