07-29-2024, 07:32 PM | #16 |
Grand Sorcerer
Posts: 12,774
Karma: 75003038
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?
|
07-30-2024, 11:03 AM | #17 |
Fanatic
Posts: 563
Karma: 5707104
Join Date: Oct 2016
Location: Somewhere in Time
Device: Forma, iPad Mini
|
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. |
Advert | |
|
07-30-2024, 12:04 PM | #18 |
Resident Curmudgeon
Posts: 76,513
Karma: 136565488
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
07-30-2024, 12:07 PM | #19 | |
Resident Curmudgeon
Posts: 76,513
Karma: 136565488
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Also, please delete your existing script or others will use it and corrupt their library. |
|
07-31-2024, 10:21 AM | #20 |
Fanatic
Posts: 563
Karma: 5707104
Join Date: Oct 2016
Location: Somewhere in Time
Device: Forma, iPad Mini
|
rclone is the superior tool. It is designed specifically to work with cloud storage providers like Dropbox and OneDrive.
|
Advert | |
|
07-31-2024, 11:18 AM | #21 |
Member
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 Last edited by sheepdog; 07-31-2024 at 11:21 AM. Reason: Adding information. |
07-31-2024, 12:50 PM | #22 |
Grand Sorcerer
Posts: 12,774
Karma: 75003038
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 Code:
sleep $wait_time |
07-31-2024, 12:58 PM | #23 |
Resident Curmudgeon
Posts: 76,513
Karma: 136565488
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
07-31-2024, 01:25 PM | #24 |
Grand Sorcerer
Posts: 12,774
Karma: 75003038
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
|
07-31-2024, 01:26 PM | #25 |
Grand Sorcerer
Posts: 12,774
Karma: 75003038
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
|
07-31-2024, 05:00 PM | #26 |
Member
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.
|
07-31-2024, 08:20 PM | #27 | |
null operator (he/him)
Posts: 21,009
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
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 |
|
07-31-2024, 10:19 PM | #28 | |
Grand Sorcerer
Posts: 12,774
Karma: 75003038
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
Quote:
|
|
08-01-2024, 11:00 AM | #29 | |
Fanatic
Posts: 563
Karma: 5707104
Join Date: Oct 2016
Location: Somewhere in Time
Device: Forma, iPad Mini
|
Quote:
|
|
08-01-2024, 11:26 AM | #30 | |
Fanatic
Posts: 563
Karma: 5707104
Join Date: Oct 2016
Location: Somewhere in Time
Device: Forma, iPad Mini
|
Quote:
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. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using Calibre on multiple computers | Waitingforatrain | Library Management | 2 | 09-19-2016 08:12 PM |
calibre and multiple computers | aielloj | Calibre | 4 | 06-26-2011 03:10 AM |
How to Duplicate My Calibre Library on Multiple Computers? | Sydney's Mom | Related Tools | 101 | 03-10-2011 01:14 PM |
Using one Calibre Library (via Dropbox) on Multiple Computers | PocketGoddess | Related Tools | 14 | 02-20-2011 05:15 AM |
Multiple computers and Calibre | starrigger | Calibre | 11 | 03-19-2009 01:14 PM |