# Is there a notebook autosave frequency configuration?

I've had Mathematica crash on me a number of times, and have had to recreate notebook contents from the last save point.

I was looking for something in the preferences like an autosave frequency configuration parameter that I could use to automatically save all my notebook content at some regular frequency to minimize losses due to crashes.

I found NotebookSave[], and a NotebookAutoSave -> True attribute for CreateDocument, but both these appear to be for manipulating external notebooks. Is there a way to do this systematically and by default?

-
I don't think there's such an option. In any case, this answer might be relevant for your needs. What it does is it saves a copy of the current notebook (with a .backup extension) upon every cell evaluation. –  rm -rf Nov 2 '12 at 5:08

You can set the NotebookAutoSave preference programmatically or via the Option Inspector.

To turn autosave on by default for all notebooks, you could do:

CurrentValue[$FrontEnd, "NotebookAutoSave"] = True  You can also set the option for individual notebooks by changing $FrontEnd to the appropriate notebook handle. According to the docs, NotebookAutoSave saves after every evaluation and seems to be inflexible in that regard.

-
Excellent. With that and checking in my notebooks to my git repository, I should have decent recoverability. I can always rollback to my last VCS commit (provided I explicitly commit after interesting changes) should I not like what has gotten autosaved, but should avoid losses due to unforeseen crashes. –  Peeter Joot Nov 3 '12 at 1:18

You could try executing

RunScheduledTask[
EmitSound[Sound[SoundNote[]]];NotebookSave[EvaluationNotebook[]], 10];


which saves the notebook every 10 seconds and plays a note.

-