Bare Bones Backup Button
- To: mathgroup at smc.vnet.net
- Subject: [mg77536] Bare Bones Backup Button
- From: Selwyn Hollis <sh2.7183 at earthlink.net>
- Date: Tue, 12 Jun 2007 01:23:53 -0400 (EDT)
- References: <200706080938.FAA03696@smc.vnet.net> <200706090943.FAA17991@smc.vnet.net> <acbec1a40706090337i64852d8cja3b1b942c7b29fec@mail.gmail.com> <06D466A7-0D44-40DB-ACB5-F488E9D2B08B@mimuw.edu.pl> <acbec1a40706090412u7c2da126nf291c7d4628d7c4a@mail.gmail.com> <14694989.1181527374589.JavaMail.root@m35> <200706110827.EAA21339@smc.vnet.net>
This is something I've wanted for years. Click the button, and a copy
of the current InputNotebook -- with output cells deleted -- is
Exported into a backup folder in your $HomeDirectory.
CreateDocument[PaletteNotebook[
Button["Bare Bones Backup",
Module[{filename, thisnb = InputNotebook[]},
If[thisnb =!= $Failed,
CreateDirectory[ToFileName[{$HomeDirectory, "MathBackups"}]];
filename = StringJoin[
StringReplace[(WindowTitle /. AbsoluteOptions[thisnb]),
s_ ~~ ".nb" -> s], "_",
StringJoin[ToString /@ Round /@ Rest[Date[]]], ".nb"];
Export[ToFileName[{$HomeDirectory, "MathBackups"}, filename],
DeleteCases[NotebookGet[thisnb], Cell[_, "Output", ___],
Infinity]]
] ] ] ] ]
(Button is new to 6, but the function inside Button should work fine
in 5.2.)
I've got a version of this that runs automatically every 15 minutes
(you can change the interval, of course). Anyone who's interested
should let me know.
Selwyn Hollis
- Follow-Ups:
- Re: Bare Bones Backup Button
- From: Murray Eisenberg <murray@math.umass.edu>
- Re: Bare Bones Backup Button
- References:
- Re: Re: v6: still no multiple undo?
- From: "Barthelet, Luc" <lucb@ea.com>
- Re: Re: Re: v6: still no multiple undo?
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: Re: Re: Re: Re: v6: still no multiple undo?
- From: DrMajorBob <drmajorbob@bigfoot.com>
- Re: Re: v6: still no multiple undo?