[TWC] LessBackupsPlugin alternative for rotating backup

156 views
Skip to first unread message

julien23

unread,
May 11, 2016, 3:19:12 AM5/11/16
to TiddlyWiki
Hi all

We use TW in synced folders (sugarsync).
Sometime the TW would not sync fast enough, and having a backup TW to fetch missing modifications is a nice thing :

[IncludeList]
<<include "Backup\index (1).html" import:4>>
<<include "Backup\index (2).html" import:4>>
<<include "Backup\index (3).html" import:4>>
<<include "Backup\index (4).html" import:4>>
<<include "Backup\index (5).html" import:4>>

Today I need to manually rename autobackups to "index 1, 2, 3 ..."

LessBackupsPlugin used to give the possibility of rotating backup, but it is no longer compatible with modern browsers.

What Alternative would you suggest ?

Regards

Julien


BJ

unread,
May 11, 2016, 6:01:41 AM5/11/16
to TiddlyWiki
Hi Julien,
I wrote a simple backup plugin that works when using tiddlyfox:

https://github.com/buggyj/tiddlywikiplugins/blob/master/simplyLessBackups.js

maybe it could be of help to you,

https://github.com/buggyj/tiddlywikiplugins/blob/master/simplyLessBackups.js

all the best
BJ

prog...@assays.tv

unread,
May 11, 2016, 8:45:41 AM5/11/16
to TiddlyWiki
BJ, Sounds great, looks erm ... like computer code. HOW does a mortal use it? :-) Josiah, x

BJ

unread,
May 11, 2016, 9:56:34 AM5/11/16
to TiddlyWiki

its a tiddlywiki classic plugin - it needs to be copied into a new tiddler and tagged with sytemConfig

julien23

unread,
May 16, 2016, 3:38:57 AM5/16/16
to tiddl...@googlegroups.com
Hi BJ

Thank you for help.

I have an issue with your code.

[PluginManager] says :
Error: SyntaxError: missing ) after formal parameters

Win7x64
FF 46.0.1
TW 2.7.2
TiddlyFox 1.0alpha18.1

Any clue ?

Regards

Julien

BJ

unread,
May 16, 2016, 5:44:19 AM5/16/16
to TiddlyWiki
what version of tiddlywiki are you using?


On Monday, May 16, 2016 at 8:38:57 AM UTC+1, julien23 wrote:
Hi BJ

Thank you for help.

I have an issue with your code.

[PluginManager] says :
Error: SyntaxError: missing ) after formal parameters

Win7x64
FF 46.0.1
TiddlyFox 1.0alpha18.1

BJ

unread,
May 16, 2016, 10:20:37 AM5/16/16
to TiddlyWiki

julien23

unread,
May 16, 2016, 10:57:40 AM5/16/16
to TiddlyWiki
BJ,
Thanks

Nows it is working.

How can I modify this code to have 1 backup /10 minutes ?
if (config.options.chkOneADayBackUpFile==true)
            backupPath
+= (new Date()).convertToYYYYMMDDHHMMSSMMM().replace (/(.*)\.(.*)/,"$1") + "." + "html";

Objective is a 6 backups rotating pattern like :
index_00.html
index_10.html
...
index_50.html

Looking forward to read from you

Julien

BJ

unread,
May 16, 2016, 12:11:37 PM5/16/16
to tiddl...@googlegroups.com
I don't understand what you mean - backups only occur when you save the tiddlywiki. Do you mean maximum of one every ten minutes? (up to 6 an hour * 24)

julien23

unread,
May 17, 2016, 8:15:20 AM5/17/16
to TiddlyWiki
BJ


backups only occur when you save the tiddlywiki

sure

but then simplyLessBackups renames backup files like :
index.20160517.0709301140.html

I would like them renamed like :
index.20160517.0709301140.html

To keep only the minutes decades.

Is this explication more specific ?

Regards

Julien

BJ

unread,
May 19, 2016, 7:32:53 AM5/19/16
to tiddl...@googlegroups.com
for what you say :
        if (config.options.chkOneADayBackUpFile==true) {
                var x = (new Date()).getMinutes();
	        backupPath += (x<10?'0':x<20?'1':x<30?'2':x<40?'3':x<50?'4':'5')+ "." + "html";
}

cheers

BJ
Reply all
Reply to author
Forward
0 new messages