In case anyone has any interest in this, I have attached a new version of my "loadnew" command with a correction to the date comparison logic.
Regards, Mal On Friday, 18 March 2016 13:37:46 UTC+10, Mal wrote: > > All, > > I am looking after some tiddlywikis with important content and have > implemented a backup scheme that involves loading the tiddlywiki html files > into a node instance and then taking file system (zfs) snapshots of the > tiddlers folder. The only problem is that the tiddlywiki --load command > always loads and saves all tiddlers regardless of whether they have been > changed, so the snapshot includes all tiddlers. The ideal would be to have > an incremental load command that only loads new or changed tiddlers into > the tiddlers folder, giving a much smaller snapshot size. > > As an attempt to achieve this, I created a "loadnew" command by cloning > the "$:/core/modules/commands/load.js" tiddler to create a new tiddler > "$:/core/modules/commands/loadnew.js" with appropriate code to limit the > imported tiddlers to only those that do not already exist in the tiddlers > folder, or have a newer "modified" date/time. > > Although this seems to be working well, I am a very amateur coder and am > not sure if this is a good way to achieve what I'm after, so I welcome any > comments or suggestions. > > For anyone interested, I've attached the resulting tid file for > reference. It is a simple matter of copying this to the node tiddlers > folder to make the --loadnew command available. However, I recommend > treating this with caution due to my previously mentioned amateur coder > status. > > Regards, > > Mal > > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/e8cd31dc-21d3-4722-942d-666aa848aa4e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
$__core_modules_commands_loadnew.js.tid
Description: Binary data