Message Boards Message Boards

0
|
5815 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Script for automated backup of a notebook

Posted 6 years ago
Attachments:
POSTED BY: Epsilon Tau
2 Replies
Posted 3 years ago

Here is another snippet which saves all open notebooks on a regular time interval. The best place for it is your init.m file.

1) Use Notebooks[] to get a list of currently open notebooks. 2) Use Extract to filter (hgo) the ones we want ( every notebook except the Messages WIndow) 3) Use NotebookSave /@ to save them 4) Use SessionSubmit to cause this to happen at a given interval

Off[Rule::argr]; (* Suppress an annoying message.  A better way would be a more specific filter  *)  

savePeriod=Quantity[300,"Seconds"];

 obj=ScheduledTask[
 hgo[aza_] :=And[  aza["DocumentType"]=="Notebook" , aza["WindowTitle"]!="Messages"] ; 

NotebookSave/@ Extract[Notebooks[],Position[ Association/@NotebookInformation /@Notebooks[],_?hgo] ] ,savePeriod]//SessionSubmit  ;
POSTED BY: peter heppel
Posted 3 years ago

Some more ideas.

Preferences setting.

From MSE, this, and this.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract