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