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 [email protected].
To post to this group, send email to [email protected].
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/b56d549e-ebd2-4f6d-a69e-657d67a3156f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: $__core_modules_commands_loadnew.js.tid
Description: Binary data

Reply via email to