Using Scrivener with Dropbox

User avatar
robertdguthrie
Posts: 3075
Joined: Mon Nov 09, 2009 10:06 pm
Platform: Mac
Location: St. Louis, MO, USA
Contact:

Tue May 06, 2014 7:34 pm Post

r6d2 wrote:Robert, have you ever experienced such a thing? And are you able to replicate it at will?

AFAIK Dropbox is clever enough to manage a change queue and do the things in the correct order to avoid this...


I believe I have experienced this, but no, I can't replicate it at will (yet). I am pondering a script that might replicate Scrivener's rapid-fire autosave (and a person's habitual invocation of File->Save keyboard shortcuts) to test out edge cases like this and tease out why some services (dropbox) work better than others (google drive, many others...). If I succeed in triggering this kind of conflict, I'll share my script & results for others to critique.

ScriverTid wrote:So, to put it in a nutshell, if I add a load of new stuff to Scrivener, I should pause Dropbox just before, then when I'm happy about what I've just pasted, unpause Dropbox? (And possibly make Scrivener's auto-save interval something fairly lengthy, e.g. like FileMaker's 5 minutes, to give Dropbox a chance to do its thing?)


I wouldn't go a whole 5 minutes. A lot of writing can happen (and be lost) if you have to wait 5 minutes without interacting with Scrivener. Note that the autosave interval is the amount of time that you have to leave a Scrivener project untouched, not the time between saves. I set my interval to 10 seconds, and haven't had any trouble since my last conflict. Note that I do not use File->Save (or the keyboard shortcut) at all, which could very well be the way some people trigger conflicts.
Often wrong, rarely in doubt.
Time for a change... I'm now rdale; same dog-avatar, same dog... channel?

kd
kdbertel
Posts: 78
Joined: Mon Oct 25, 2010 10:20 pm
Platform: Windows

Wed May 07, 2014 1:10 am Post

robertdguthrie wrote:Note that I do not use File->Save (or the keyboard shortcut) at all, which could very well be the way some people trigger conflicts.


Unfortunately, the ⌘-S shortcut is just too heavily ingrained in me after years of Ctrl-S on Windows machines that had a tendency to crash unexpectedly. I don't even realize I'm doing it most of the time (which is fun when I do actually have documents I don't actually want to save).

So far, I've just been doing the turn-Dropbox-off-before-using-Scrivener thing. I'd love if there were some script or something I could do in OS X to have that happen automatically around Scrivener, though.

User avatar
robertdguthrie
Posts: 3075
Joined: Mon Nov 09, 2009 10:06 pm
Platform: Mac
Location: St. Louis, MO, USA
Contact:

Wed May 07, 2014 12:57 pm Post

kdbertel wrote:So far, I've just been doing the turn-Dropbox-off-before-using-Scrivener thing. I'd love if there were some script or something I could do in OS X to have that happen automatically around Scrivener, though.


It seems someone on the forums created such a script. Essentially, you can create one yourself by stringing together commands in a script like this:
osascript -e 'tell application "Dropbox" to quit'
open -a "Scrivener"
open -a "Dropbox"

I haven't tested the above, so you'd need to read up on the open command in mac os x, but if you created a shell script with the above contents, and then added that to your dock, you could launch that instead of invoking Scrivener directly.
Often wrong, rarely in doubt.
Time for a change... I'm now rdale; same dog-avatar, same dog... channel?

kd
kdbertel
Posts: 78
Joined: Mon Oct 25, 2010 10:20 pm
Platform: Windows

Wed May 07, 2014 1:23 pm Post

robertdguthrie wrote:It seems someone on the forums created such a script.

I believe I linked to one earlier. The main problem I have with it (aside from the fact that I haven't gotten it to work right on Mavericks) is that it quits Dropbox instead of simply pausing it. My Dropbox is otherwise large enough that it's an annoyingly long operation to start Dropbox because of all the re-indexing it has to do.

With Syrah/Yosemite on the horizon, I'm inclined to wait until I get ahold of that before I fiddle with it too much more. Not that I'm convinced Dropbox has an API to pause itself. :(

Sh
Shenandoah
Posts: 9
Joined: Sun Jan 13, 2008 5:31 pm

Sat May 31, 2014 2:21 pm Post

@robertdguthrie: Many thanks for your thorough, clear explanation of how the Dropbox sync - Scrivener architecture can 'lose' updates to a project.

I definitely have experienced this moving between Macs. (In fact, that's how I found this thread and your post: seeking a solution to this very problem.)

My experience with this phenomena, consistent with your description, is when I have updated files in rapid fire -- such as at the end of the work day. Then, upon arriving home to complete the project, due first thing in the morning, I discover that all those little recent (brilliant, irreproducible) updates were not in the latest version opened from Old Reliable Dropbox. Cue panic.

Now that I understand what's happening behind the curtain, I may do the (so very counter-intuitive) Pause Dropbox thing until closing down Scrivener at the end of my writing \ editing session. While that feels wrong, it sure beats 'losing' work! (Though, by the way, I alway was able to find the missing updated file(s) whenever I managed to remember an exact phrase from the most recent editing session. Unfortunately, i tend to write things down instead of remember them!)

User avatar
kewms
Posts: 5445
Joined: Fri Feb 02, 2007 5:22 pm
Platform: Mac

Sat May 31, 2014 6:28 pm Post

There's a procedure for recovering from Dropbox conflicts up-thread, here:
viewtopic.php?f=2&t=11725&start=120#p149048

Briefly, it involves finding the "lost" updates in your project, and then re-importing them so that Scrivener knows they exist.

Katherine
Scrivener Support Team

ka
kannmoore
Posts: 3
Joined: Tue Jun 10, 2014 6:17 pm
Platform: Windows

Tue Jun 10, 2014 6:22 pm Post

Sorry if this has been addressed already but I didn't see it when skimming this thread. When I have attempted moving my .scriv file into dropbox, it will open on the second pc but all the chapters are blank. All the folders are there in the binder but there is no content. What am I doing wrong?

User avatar
AmberV
Posts: 23719
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Tue Jun 10, 2014 6:29 pm Post

When you say you’re moving a file, that may be the problem right there. A Scrivener project is a whole folder, with a lot of files in it. If you aren’t copying that whole thing then you have not copied your project, only pieces of it.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

ka
kannmoore
Posts: 3
Joined: Tue Jun 10, 2014 6:17 pm
Platform: Windows

Tue Jun 10, 2014 6:49 pm Post

Dropbox does not let me upload the entire folder. It forces me to open each folder and choose a single file. To work around this I used dropbox in my browser and drag and dropped the entire folder into it but now when I open the project it says that I dont have access and the file is unwriteable.

ka
kannmoore
Posts: 3
Joined: Tue Jun 10, 2014 6:17 pm
Platform: Windows

Tue Jun 10, 2014 7:23 pm Post

I figured out that the issue I was having was the Dropbox windows 8 app UI. I installed a regular desktop version and I seem to have success!

User avatar
AmberV
Posts: 23719
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Tue Jun 10, 2014 7:29 pm Post

Ah, yes, it's hardly Dropbox without installing it. :)

But on the matter of cases where you *do* need to use their website to upload material, all you have to do is compress the folder with zip down to a single file. Now you can upload it efficiently and extract the full project on the second machine.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

mb
mbauer
Posts: 1
Joined: Tue Sep 02, 2014 2:43 pm
Platform: Mac

Tue Sep 02, 2014 2:51 pm Post

You can at least automate having a reminder/notification raised to pause Dropbox Syncing when a Scrivener file is opened. I do this with the Hazel utility from Noodlesoft; tasking it watch for.scriv files being opened and raising a notification "Please Pause DropBox." I imagine it's possible to have automator do something similar. I still have to use the DropBox menu to do the pause/unpause, but I'm always reminded.

I wonder if a future version of Scrivener could have an option to raise a notification of this sort? I'd also like an option to have Scrivener quit after some set amount of inactivity in case I forget to do so on my work computer.

User avatar
AmberV
Posts: 23719
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Ourense, Galiza
Contact:

Tue Sep 02, 2014 9:52 pm Post

We don’t consider pausing to be an essential ingredient to using synchronisation services with Scrivener. It is an optional step one can take, primarily to have the effect of reducing the number of versions the sync software stores on the server. Instead of 80 .scrivx files resulting from one session, pausing would mean only one .scrivx for that session would updated on the server, making recovery a much simpler matter if the need for that should arise.

Pausing does not mitigate the most common form of damage that can be done, by shutting down a computer before sync has completed updating the server, or starting to use Scrivener before the sync service has fully updated the current workstation (which includes offline editing prior to syncing). Education is the only answer to these problems. Pausing can in fact exacerbate problems, as it is one more thing you have to remember to do, and forgetting to unpause a computer will nearly always cause conflicts to arise.

I’d also like an option to have Scrivener quit after some set amount of inactivity in case I forget to do so on my work computer.


Yes, that will likely be a feature in a future version of Scrivener, as a per-project setting.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

User avatar
kewms
Posts: 5445
Joined: Fri Feb 02, 2007 5:22 pm
Platform: Mac

Wed Sep 03, 2014 12:20 am Post

AmberV wrote:Pausing does not mitigate the most common form of damage that can be done, by shutting down a computer before sync has completed updating the server, or starting to use Scrivener before the sync service has fully updated the current workstation (which includes offline editing prior to syncing). Education is the only answer to these problems. Pausing can in fact exacerbate problems, as it is one more thing you have to remember to do, and forgetting to unpause a computer will nearly always cause conflicts to arise.


FWIW, DevonThink Pro will flat refuse to shut down until it has finished syncing, to the point of overriding the OS X shutdown sequence if needed. Doing this, however, is only possible because they've built their own synchronization tools rather than relying on what OS X/Dropbox alone can do.

It's actually pretty annoying. They treat synchronization as a separate operation, which renders DTP pretty much unusable while it's going on. It doesn't happen quietly in background while you're working, the way a normal Dropbox sync does. This makes the synchronization step fairly slow, and therefore self undermining: if I get tired of waiting for it (or have to get on my airplane), close the lid on my laptop, and walk away from my internet connection, then I'm still left with the database in an indeterminate, unsynchronized state. (And this problem is not fixable in software: no synchronization scheme on earth will be able to continue if connectivity is lost.)

This still isn't catastrophic. Since DTP itself is doing the syncing, it can ultimately discover any conflicts that are created and ask me to resolve them. On the other hand, it's completely possible -- as with Scrivener -- for me to get back to my home computer, fire a database up, and discover that some files are "gone" because they're trapped in the unsynced portion of the other system. Easily fixed, but scary if I don't know what's going on. Ultimately, I think the best solution to this kind of problem is, as Ioa said, education. Make sure that you understand how sync works, what the symptoms of a sync conflict are, and how to resolve one.

Katherine
Scrivener Support Team

sa
saoir
Posts: 361
Joined: Sat May 04, 2013 10:40 pm
Platform: Mac

Wed Sep 10, 2014 4:40 pm Post

AmberV - what concerns me 'slightly' is this. When I quite Scrivener, it is set to save, which it does. But I notice that Dropbox starts to sync immediately. and I mean 'immediately'. I find it hard to believe that Scrivener has saved it's files by the time Dropbox starts to sync, and hence I have been seduced into pausing Dropbox while writing as others do.

Can you say something about this process ? The Scrivener saving and the initiation of the sync by Dropbox ?
Howard Brittain

Author of just published "Vineyard"
An MI5/Thriller.
Blog