Nodejs and backups

Well I’m currently trying to backup from my mistakes moreso than fs stuff, so say i delete most of the tiddler trying to re-organize this is a new wiki i dont really know what im trying to backup.

I’m not even using a full linux build (right now trying to keep it simple enough to understand) so don’t want to rely on complicated stuff like zfs/mounted filesystems.

Right now rsync --backupdir option has variable to enumerate 10 changes with a mv sticking the first change of the day per file in the first hour in a folder for archival for shipping off to the backup server.

I’m thinking I’m lucky to have 1 good thought a day and dont expect it to take longer than an hour to save it, but the enumeration stuff above will keep 10 previous versions (per tid) so… it’s not part of a backup but I can manually go and fix a mistake as long as I haven’t changed the file more times than that and the daily first move/archive will mitigate against that is the goal.

So the idea is i can catch something daily in those 10 enumerations and have a worst case yesterday backup for each file.

And then probably rsync daily to a mirror for periodic backups separately for the “eveything else” scenario.

This is the most complicated “simple script” I had hoped for me sadly on linux so far i’m a beginner… probably lots of bugs it deletes your data but it seems to be working ok so far id put it out there if it sounds interesting but it’s a first draft and probably not pretty.

I’m surprised there isnt a “last tiddler save” or revert option i guess(?) in the nodejs version that would be really cool probably, probably stop a good majority of my faux pas by itself

potentially the reason there isn’t a nodejs option for this, is that it’s something any user of TW may desire, regardless of node vs single-file.

@Yaisog has this plugin which adds internal revisions - works on both single file and node (well, I assume anyway. I dont use it myself)

https://yaisog-patches.tiddlyhost.com

From discussion here: In-Wiki Incremental Revisions -- Now Even Better!

That seems a very powerful of an option there it’s complicated enough I don’t know how much time I’d want to try right now if nodejs may be a gotcha. I’ve got maybe 20 wiki tid’s if that, and i don’t really understand how tiddlywiki is still working without nodejs these days with all the extension combinations needed for each browser/client, but that’s interesting if just a simple revert/copy or some wouldn’t get too complicated to think about.

Plugins should work the same, since they operate browser side. Except for saving (whole file to local disk vs individual tid over the network) (and maybe some other corner cases that escape my awreness at the moment) TW in the browser doesn’t really care where the page came from - be it a local large single file, or over the network from a node instance that assembles basically the same thing from it’s local collection of many files.

In short, I’d be quite surprised if there WAS a difference in behaviour. I only added the disclaimer because I’m aware of the limits of my awareness on the topic in depth.

You should be able to test it by a simple drag-and-drop onto your TW (and if it doesn’t work, then removal should be similarly easy - and worst case, make a backup before testing this and then revert to that backup. )(Sometimes that’s what I use backups for. Not disaster recovery, just “easier than the other also-technically-possible ways to get a system back to an earlier state”)

It looks really complicated I’d hate to add that much complexity right now. Maybe if the backups get larger than a megabyte. …one thing I miss about the web page option… one day it’s overly complicated. I don’t know how nodejs works… but it does…