Regular online backup

14 views
Skip to first unread message

Nicolas Syssoieff

unread,
Feb 15, 2008, 8:35:40 AM2/15/08
to tiddlywiki
Hi all,

I have a question regarding saving the TW with the "save to web" feature (my site is hosted on TiddlySpot).
Is there a way to save my TW periodically (say, every 5 minutes), no matter if I'm editing it or not ?

It often happened to me that I edited a lot of things in my TW during workday, then wanted to review something at home in the evening, just to realise that I forgot to save at work, and that my work is not gone, but still waiting for me on my work computer.. at work.

I realise fully that this would not be as powerful as the AutoSave feature when using TW locally (I can't see how to implement an AutoSave feature online, that would be too demanding I guess), but still it would offer some protection in case of the previous example or if, for example, my browser crashes or something like that.

In my mind, it's something as simple as automating the "save to web" button to run every 5 minutes, but how is that feasible, I have no idea...

Thoughts anyone ?
Nicolas.

FND

unread,
Feb 15, 2008, 4:01:15 PM2/15/08
to Tiddl...@googlegroups.com
> Is there a way to save my TW periodically (say, every 5 minutes), no
> matter if I'm editing it or not ?

This is possible as long as the TiddlyWiki document remains open in the
browser.

Try this macro:
http://fnd.lewcid.org/svn/TiddlyWiki/plugins/PeriodicUploadsMacro.js
It's largely untested, so make sure you create a backup first.

You can find the required data in your [[TspotControls]] shadow tiddler.
There's a macro call like this:
<<upload http://foo.tiddlyspot.com/store.cgi index.html . . foo>>
(with "foo" being your site ID)
Just change "<<upload" to "<<periodicUpload 300" (this additional
parameter specifies the interval in seconds).
You will still have to enter your password in the respective field, of
course.

HTH.


-- F.

Rafiki Cai

unread,
Feb 15, 2008, 5:10:08 PM2/15/08
to Tiddl...@googlegroups.com
F:

Can the store.cgi easily function from any domain?  Or is there some indepth configuration, that's necessary for being able to automatically upload to a non-TSpot URL?

Is there a way, that a simple tag would prevent the macro from uploading a tiddler?  Say for example, a Journal Keeper wanted some tiddlers to be uploaded, for public consumption; and others not to be uploaded.

Please advise.

RC
--
"The ONENESS of The Allness is the key that we seek. When will we all catch on?"



--
"The ONENESS of The Allness is the key that we seek. When will we all catch on?"

FND

unread,
Feb 15, 2008, 5:56:08 PM2/15/08
to Tiddl...@googlegroups.com
> Can the store.cgi easily function from any domain?

Yes; Tiddlyspot uses the UploadPlugin*, which can be made to work anywhere.
Also see this page on the community wiki:
http://www.tiddlywiki.org/wiki/Server-Side_Solutions

> Is there a way, that a simple tag would prevent the macro from uploading
> a tiddler? Say for example, a Journal Keeper wanted some tiddlers to be
> uploaded, for public consumption; and others not to be uploaded.

That's something BidiX (the UploadPlugin's author) would have to answer.


-- F.


* http://tiddlywiki.bidix.info/#UploadPlugin

BidiX

unread,
Feb 16, 2008, 5:04:43 AM2/16/08
to Tiddl...@googlegroups.com


On Fri, Feb 15, 2008 at 11:56 PM, FND <FN...@gmx.net> wrote:

 

On Fri, Feb 15, 2008 at 11:10 PM, Rafiki Cai <rafi...@gmail.com> wrote:
 

> Is there a way, that a simple tag would prevent the macro from uploading
> a tiddler?  Say for example, a Journal Keeper wanted some tiddlers to be
> uploaded, for public consumption; and others not to be uploaded.


For now UploadPlugin and UploadService scripts (store.php and store.cgi) are working on a per file basis. That's to say that the whole TiddlyWiki is rebuilt at each upload, exactly as it is in a save command.

For your request, we should have a per tiddler upload scheme. It is an other story ... and an other store script !

Have you think about to manage 2 TW a private one for your private notes uploaded in a private TW and a public one ?

-- BidiX
http://bidix.info

Nicolas Syssoieff

unread,
Feb 16, 2008, 9:03:13 AM2/16/08
to Tiddl...@googlegroups.com
Hi FND,

I have tested your macro for half a day, it seems that it is working just perfectly :)
I'll let you know if something seems to be wrong on a longer term basis.

Thanks a lot !

Nicolas.

FND

unread,
Feb 16, 2008, 7:00:22 PM2/16/08
to Tiddl...@googlegroups.com
> I have tested your macro for half a day, it seems that it is working
> just perfectly :)

Glad to hear that! I've now changed the status from experimental to beta.


-- F.

Nicolas Syssoieff

unread,
Feb 18, 2008, 2:24:01 AM2/18/08
to Tiddl...@googlegroups.com
Hi FND,

After a little more testing, I confirm that the plugin is still working as expected.
Just a remark : I have found it easier to put in within reach, just below "save to web" in the Tspotsidebar, instead of Tspotcontrols, which needs to be individually accessed to start/stop the macro. This allows for a quick access to the button, to deactivate it when I'm working on the TW intensively and don't want to be disturbed by the spontaneous saving process, and to activate it the rest of the time.

Nicolas.

Nicolas Syssoieff

unread,
Feb 21, 2008, 7:28:24 AM2/21/08
to Tiddl...@googlegroups.com
Hi FND,

After a few more days, I have yet one more suggestion for your beta PeriodicUploadsMacro.
It would actually be cool that the on/off toggle of the macro state could be kept somewhere, and restart in this state the next time the TW is loaded (maybe it would also be nice that everyone could choose via an options dialog if he wants this capability or if he prefers the TW to start all the time with the macro set to off, but that's yet another question).

The reason I'm suggesting this is beacuse I'm actually using it in conjunction with Eric's last suggestion to implement a "SaveAndReloadMacro-like" function to an online upload [1], which actually also works well.

But as you might understand, my upload-and-reload functionality always reloads a TW where the periodic upload is off, which makes it... non-periodic ;). I would like it to remain in the state it was before reload so that it becomes a real periodic-upload-and-reload function.

Does that make sense ?

Thanks for your advice.
Nicolas.


[1] http://groups.google.com/group/TiddlyWiki/browse_frm/thread/17ade817a9829f85/2bfc3562997ad77d?lnk=gst&q=upload+and+refresh#2bfc3562997ad77d

Nicolas Syssoieff

unread,
Feb 21, 2008, 7:29:00 AM2/21/08
to Tiddl...@googlegroups.com
Hi FND,

After a few more days, I have yet one more suggestion for your beta PeriodicUploadsMacro.
It would actually be cool that the on/off toggle of the macro state could be kept somewhere, and restart in this state the next time the TW is loaded (maybe it would also be nice that everyone could choose via an options dialog if he wants this capability or if he prefers the TW to start all the time with the macro set to off, but that's yet another question).

The reason I'm suggesting this is beacuse I'm actually using it in conjunction with Eric's last suggestion to implement a "SaveAndReloadMacro-like" function to an online upload [1], which actually also works well.

But as you might understand, my upload-and-reload functionality always reloads a TW where the periodic upload is off, which makes it... non-periodic ;). I would like it to remain in the state it was before reload so that it becomes a real periodic-upload-and-reload function.

Does that make sense ?

Thanks for your advice.
Nicolas.


[1] http://groups.google.com/group/TiddlyWiki/browse_frm/thread/17ade817a9829f85/2bfc3562997ad77d?lnk=gst&q=upload+and+refresh#2bfc3562997ad77d

On Mon, Feb 18, 2008 at 8:24 AM, Nicolas Syssoieff <nicolas....@gmail.com> wrote:

FND

unread,
Feb 21, 2008, 9:25:05 AM2/21/08
to Tiddl...@googlegroups.com
> It would actually be cool that the on/off toggle of the macro state
> could be kept somewhere, and restart in this state the next time the TW
> is loaded

I had thought about that, but dismissed it because it can be quite
dangerous to automatically start uploading.

Nevertheless, I've updated the macro to add an option for the interval:
http://fnd.lewcid.org/svn/TiddlyWiki/plugins/PeriodicUploadsMacro.js
However, because this is such a potentially dangerous thing, I've
changed the status back to experimental until I can figure out a way to
take care of these issues (see the plugin's To Do section).


-- F.

Nicolas Syssoieff

unread,
Feb 21, 2008, 9:43:11 AM2/21/08
to Tiddl...@googlegroups.com
Hi FND,

It's interesting how you developed the modification, but maybe this will eventually get complicated in the user's mind between the timer he defined in the <<periodicUpload interval .....>> macro call, and the other interval he defined for automatic upload within the plugin.
What about an implementation where you define no second interval field such as you did here, but only a checkbox ?
The <<periodicUpload 300 .............................>> call could remain the only place where you define the interval with a numeric value, and the checkbox in the plugin would only toggle the states between :
- always initialize the above-defined macro as ready to "Start"
or
- always initialize the above-defined macro in the state it previously closed, either "Start" or "Stop".

Then, to counter the dangerous potential of such a thing, you could have people enter "AUTOMATIC" in an input field in the plugin, instead of just checking a checkbox. This will reduce the potentiality of an unwanted accidental box-checking.

Nicolas.

FND

unread,
Feb 21, 2008, 2:06:34 PM2/21/08
to Tiddl...@googlegroups.com
> It's interesting how you developed the modification, but maybe this will
> eventually get complicated in the user's mind between the timer he
> defined in the <<periodicUpload interval .....>> macro call, and the
> other interval he defined for automatic upload within the plugin.

Yeah, that was why I wasn't at all happy with the solution.
I have reverted to v0.5 (now considered stable) and will write a
separate, though more complex plugin that does this differently.
I hope to be done by tomorrow, but you never know, I might run into
problems and lose interest...


-- F.

FND

unread,
Feb 21, 2008, 3:38:34 PM2/21/08
to Tiddl...@googlegroups.com
> I have reverted to v0.5 (now considered stable) and will write a
> separate, though more complex plugin that does this differently.

Here's the first version:
http://fnd.lewcid.org/svn/TiddlyWiki/plugins/PeriodicUploadsPlugin.js
There's a lot of room for improvement, but it seems to do the job.

It's also not as lightweight as the PeriodicUploadsMacro and requires
TiddlyWiki v2.2 (due to the backstage integration), which is why I won't
retire the macro version.


-- F.

Nicolas Syssoieff

unread,
Feb 22, 2008, 2:51:30 AM2/22/08
to Tiddl...@googlegroups.com
Hi FND,

I reverted to the 0.5 stable macro version and installed this plugin.
Just below the PeriodicUploadsConfig inclusion within the plugin, I have :

"Error in macro <<periodicUploads>>", and clicking on it provides the error message :
   Error while executing macro <<periodicUploads>>:
   ReferenceError: console is not defined

Am I doing something wrong ?

Nicolas

FND

unread,
Feb 22, 2008, 3:11:35 AM2/22/08
to Tiddl...@googlegroups.com
> Error while executing macro <<periodicUploads>>:
> ReferenceError: console is not defined

Sorry, my bad; I forgot to remove all debugging calls. It should work now.


-- F.

Nicolas Syssoieff

unread,
Feb 22, 2008, 3:35:52 AM2/22/08
to Tiddl...@googlegroups.com
Hi FND,

No worries, given the delay in which you coded it, I could hardly blame you for that.
Is it an update on this link ?
http://fnd.lewcid.org/svn/TiddlyWiki/plugins/PeriodicUploadsPlugin.js

It seems to be the same one for now, but it's possible that I'm on the wrong repository :)

Nicolas.

FND

unread,
Feb 22, 2008, 3:38:37 AM2/22/08
to Tiddl...@googlegroups.com
> Is it an update on this link ?
> http://fnd.lewcid.org/svn/TiddlyWiki/plugins/PeriodicUploadsPlugin.js
> It seems to be the same one for now

That's the location; I just removed a console.log() call from the
initOption() function.


-- F.

Nicolas Syssoieff

unread,
Feb 22, 2008, 4:26:01 AM2/22/08
to Tiddl...@googlegroups.com
Hi,

This time it's my bad, my damn browser's cache did not want to reload the page correctly.
I installed the update.

However (you're gonna hate me ;o) I now have another error.

When I click on start and wait for the interval, I see this :
About to upload on http://devoroumov2.tiddlyspot.com/URL of server-side store script (e.g. {{{http://www.domain.tld/upload directory on server (usually {{{./}}})/filename on server (usually {{{index.html}}}) ...
so I think something does not get replaced in the syntax, because part of it comes from my configuration, part of it looks like the tooltip itself.

Also, when the "automatically start periodic uploads" checkbox is checked, there is an error to even render the macro :
Error while executing macro <<periodicUploads>>:
TypeError: this.firstChild has no properties

Nicolas

FND

unread,
Feb 22, 2008, 9:30:34 AM2/22/08
to Tiddl...@googlegroups.com
> However (you're gonna hate me ;o) I now have another error.

Actually, I'm hating myself - for some reason (copy & paste error?) I
was accessing the wrong object there (optionsDesc rather than options).

> TypeError: this.firstChild has no properties

Yeah, there was a small logical error there.

Both of these issues should be fixed now:
http://fnd.lewcid.org/svn/TiddlyWiki/plugins/PeriodicUploadsPlugin.js
(I haven't updated the version number though, as the previous versions
were non-functional - so consider this the first proper release then)

Now I'm curious to see what other bugs you can find...


-- F.

Nicolas Syssoieff

unread,
Feb 22, 2008, 10:10:34 AM2/22/08
to Tiddl...@googlegroups.com
Hi again FND,

We are definitely very close :
- now the plugin does indeed upload the TW to the appropriate location
- and the plugin is rendered without an error when the automatic upload is checked.

However, this automatic upload... is still failing somehow.
When I reload the TW after a save, all <<periodicUploads>> triggers now show "Stop", suggesting that the macro is indeed running... but nothing happens after the 30-second interval. When I stop-start the macro, it works again.

As a side-comment, I have also noted a little (non-blocking) issue : if I create multiple <<periodicUploads>> triggers (say, one in SidebarOptions and one in Mainmenu, as an example), toggling one from Start to Stop does is not reflected on the others... this can lead to some confusion if you want to determine if the macro is running or not.

Btw, you can use (as for the DeleteTiddlersMacro question) the http://devoroumov2.tiddlyspot.com - password is "trivial" - to reproduce the issue if you wish.

Nicolas

FND

unread,
Feb 22, 2008, 10:36:39 AM2/22/08
to Tiddl...@googlegroups.com
> However, this automatic upload... is still failing somehow.

Well, I've only tested it by emulating the UploadPlugin - which worked
fine - but I guess I'll have to dig deeper.
However, time might be tight the next few days. Keep reminding me though
if I haven't responded after a week or so.

> if I create multiple <<periodicUploads>> triggers (say, one in
> SidebarOptions and one in Mainmenu, as an example), toggling one from
> Start to Stop does is not reflected on the others...

I'm aware of that - but I don't think there's a lot I can do there,
other than searching the entire document for those buttons.
Since you'd normally only have a single button outside the backstage
area anyway, I don't think that warrants the effort, code bloat and
performance hit.


-- F.

Nicolas Syssoieff

unread,
Feb 22, 2008, 10:44:12 AM2/22/08
to Tiddl...@googlegroups.com
Hi again,


> However, time might be tight the next few days. Keep reminding me though
if I haven't responded after a week or so.

Ok for that, I'm not in such a hurry that I cannot wait for a week or so, so take your time :)


> I'm aware of that - but I don't think there's a lot I can do there,
> other than searching the entire document for those buttons.
> Since you'd normally only have a single button outside the backstage
> area anyway, I don't think that warrants the effort, code bloat and
> performance hit.

I mentioned it only so that you would know, but I agree with that, it's not worth the effort :)

Nicolas.

FND

unread,
Feb 23, 2008, 4:46:41 AM2/23/08
to Tiddl...@googlegroups.com
> Ok for that, I'm not in such a hurry that I cannot wait for a week or
> so, so take your time :)

Had I let this slip for a week, I probably would've had a hard time
motivating myself again. So get v0.6 here:
http://fnd.lewcid.org/svn/TiddlyWiki/plugins/PeriodicUploadsPlugin.js

Turns out that UploadPlugin itself already provides configuration
options since v3.1.0, so I could remove quite a bit of unnecessary code
and simplify the whole process.
Since I'm also making use of the existing backstage tab, you'll need
UploadPlugin v4.1.0 or greater.

I've tested this with a local setup, and it seems to work fine. Let me
know if you encounter any more issues.

BidiX, if you're reading this, got any suggestions on how this plugin's
options could be better integrated with the UploadPlugin's backstage
tab? It looks kinda ugly/haphazard right now...


-- F.

Nicolas Syssoieff

unread,
Feb 25, 2008, 8:50:38 AM2/25/08
to Tiddl...@googlegroups.com
Hi FND,

Sorry for coming back to you only today regarding the Periodic Upload Plugin. I feel lost because I don't know what's going wrong, maybe I'm missing something trivial.

I took an empty TW, upgraded UploadPlugin (for version 4.1), installed PasswordOptionPlugin that is required with it, installed PeriodicUploadsMacro and PeriodicUploadsPlugin, saved and restarted.

Now, I have indeed a couple new options in the backstage upload tab, that I can set.

But the macro call button, in addition to always starting showing "stop", does absolutely nothing, the button is toggled from "stop" to "start" but without any effect... I have no idea where to start looking... :)
On the other hand, an "old" call to <<periodicUpload 300 ......>> still works.

What can I try to make it work ?
If you wisk to have a look, feel free. (http://devoroumov2.tiddlyspot.com - password "trivial" as usual)

Nicolas.

FND

unread,
Feb 25, 2008, 2:31:07 PM2/25/08
to Tiddl...@googlegroups.com
> But the macro call button, in addition to always starting showing
> "stop", does absolutely nothing, the button is toggled from "stop" to
> "start" but without any effect...

Not sure what the problem might be here - it worked fine when I tested it.
However, I'm afraid I can't focus on this kind of thing right now; it
might take a week or more until I'm back in action - so remind me again
then.


-- F.

Reply all
Reply to author
Forward
0 new messages