When the project closes unexpectedly, Scrivener has to rebuild the indexes to check for errors. It normally does this as part of its routine shutdown process. For this and other reasons, it’s best to avoid catastrophic shutdowns whenever possible.
My own autosave interval is set to 10 seconds. The “right” interval depends on how smooth a typist you are, how often you naturally pause, and so on. Generally, if you find the autosave intrusive, make the interval longer until it isn’t.
If you’re concerned about data loss, please also check Scrivener’s Scrivener -> Preferences -> Backups pane to make sure the options match the way you work. For instance, a backup that only runs when you close the program won’t help much if you tend to leave Scrivener running for days at a time. I also strongly recommend using a Time Machine volume and a remote backup service such as BackBlaze. Please note that “cloud” services like Dropbox and iCloud are not in themselves sufficient to protect your data.
Thanks, but this is precisely the point of my question.
If the project itself is auto-saved regularly during idle, why aren’t the indexes also saved at the same time? If the project has not changed between the last auto-save and the unexpected closing, then why must the indexes be rebuilt?
Search indexes are only saved on project close. The reason for this is that the project search indexes are maintained in a single XML file inside the project. This file contains a plain text representation of all the text in your project, which means it can grow to megabytes in size, slowing down the save. If it were re-written to disk on every auto-save, you would have to wait a couple of seconds for the save to complete in large projects, which would be frustrating. Since search index data is non-essential, in that it can easily be recreated since it is a duplication of other data in the project, it is therefore saved on project close only. This is why search indexes need to be rebuilt if the project is not closed properly.
I may in the future move to a different model where there is a separate plain text index file for each individual section, which would allow for search indexes to be saved on auto-save (since the whole project text would not need saving). However, having many more files inside the project .scriv wrapper has implications on sync speed - especially in the Dropbox iOS API.
All the best,
I found the AutoSave Interval option! It was set for 2 seconds. But clearly it was not doing its thing if I’m supposed to be able to just open up the same project and find the work saved. It had reverted to the project state when I first opened it today.
Any hints on how to recover the lost work or how I can prevent this from happening in the future?
I must be missing something. I don’t see any option for Autosave Intervals under the Backup pane in Preferences. It looks like the only options are manual saves and saving on open and close (see attachment). But clearly I’m missing something.
I just lost about an hour’s worth of work after a catastrophic crash, so I’m damned keen on finding a solution to this.
Where can I find the Autosave option?
[attachment=0]Screen Shot 2020-11-11 at 1.19.59 PM.png[/attachment]
You will find autosave intervals in Scrivener Preferences.