Using Scrivener with Dropbox

That’s pretty much what I expected, unfortunately. Thank you for the quick response, even if it was a pretty stupid question most likely.

(I apologise if this has already been covered in this topic ) :

All this talk of losing stuff in Dropbox… I once lost everything (my own fault!) but I discovered when panic mode was subsiding, that Dropbox do archive everything you’ve had in the folder and keep it for 30 days after deletion, including individual files you have deliberately trashed. So, you don’t lose anything with Dropbox - just download from the archive anything you want : that could be a pre-corruption Scrivener project, or anything at all.

By the way, from reading through these posts, I feel I should not have Dropbox active while working on a Scrivener project - if not, why not? I’m not sure - as a newbie - that I quite ‘get’ that.

Pausing dropbox is a way to exercise an abundance of caution that some see an insufficient and others see as overkill.

The reason you would want to pause is to avoid letting any rapid-fire saves cause conflicts.

Let’s say you have a file in your project and you paste in a large amount of text (and maybe even pictures). After the paste auto-save to kicks in. With dropbox active, it will begin to upload that pasted data. Unfortunately, there’s a network slowdown for some reason; maybe dropbox didn’t pay your ISP for high-speed access to its customers (see: Net Neutrality issues in the US), or maybe it’s just network congestion. Regardless of the cause, it’s going to take a while, maybe longer than a minute, to upload the changes to your file.

You decide you didn’t mean to paste the text & graphics that you did into your file, so you hit undo (CMD-Z on the mac), grab the text you really wanted and paste that into the document instead. Autosave kicks in again. Locally, there’s nothing wrong, but the Dropbox program has a problem; it needs to upload the changes right now, but it’s still in the process of uploading the previous set of changes. So it creates a “conflicted” copy of the file inside your project and saves your latest version there.

Scrivener has no idea about the new conflicted file that was created, and the file that it thinks has the latest changes in it actually has the older version. So now there’s a conflict between what Scrivener has loaded into its editor and what is stored in the file that it thinks contains that data. Meanwhile, there’s a file inside the project bundle that you can’t see, and Scrivener may not ever notice.

See how that could be bad? By pausing the sync, you avoid at least this one scenario where conflicts can arise. Re-enabling the sync after you’ve quit scrivener means that there’s plenty of time for all of your changes to be uploaded without any interference from Scrivener itself.

With all that said–I don’t pause dropbox. But I don’t import large documents very often, and I don’t make rapid-fire decisions about changing them, and I’m always sure to let the dropbox sync finish before logging out of the computer I’m on.

That’s a helpful answer.

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?)

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.

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.

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.

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.

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. :frowning:

@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!)

There’s a procedure for recovering from Dropbox conflicts up-thread, here:
https://forum.literatureandlatte.com/t/copy-without-annotations-footnotes/161/1

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

Katherine

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?

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.

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.

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!

Ah, yes, it’s hardly Dropbox without installing it. :slight_smile:

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.

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.

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.

Yes, that will likely be a feature in a future version of Scrivener, as a per-project setting.

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

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 ?