Giter Club home page Giter Club logo

file-backups's Introduction

File Backup Utility For TiddlyWiki

Introduction

This browser add on is designed to let you easily save and backup TiddlyWikis. It is a file-based system for a single user. If you'd like your TiddlyWiki available over the network or in the cloud, please check out other options at "Getting Started With TiddlyWiki"[1].

This add on should work with any browser that supports web-extensions. So far it's been tested with FireFox 56 ... up to FF 74 beta (2020.03.10).

It will save TiddlyWiki5 and TiddlyWikiClassic files. For TiddlyWikiClassic the TW internal backup mechanism is switched off!

For an overview of this add on please see the introduction video: https://youtu.be/KVLtID8nElU

Installation

To install, go to: Mozilla AddOn Store

If you want to help with the AddOn development. Have a look at the Beta-versions.

File Storage Locations

Main File Limitations

To help keep you secure, most modern browsers limit writing files to only a few locations.

This means this add on can only write to your "Downloads" folder and its subdirectories.

For example on Windows 7 or newer, it's usually C:\Users\<name>\Downloads

It's a good idea to keep your TiddlyWiki in it's own subfolder. So, you'll end up with something like

  • C:\Users\<name>\Downloads\myWikis\todo.html or
  • C:\Users\<name>\Downloads\myWikis\notes.html

The Backup Folder (Optional)

The default backup folder is called twBackups. This can be changed in the options. It's set globally and is relative to the wiki location.

For example if your TiddlyWiki is C:\Users\<name>\Downloads\myWikis\notes.html the backup folder defaults to C:\Users\<name>\Downloads\myWikis\twBackups\notes(A).html

The Backup Strategy

The backups are created using a slightly modified "Tower of Hanoi" rotation strategy, similar to some tape based backup software.

The following table shows the numbering system, with 4 different files.

Backup Number 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
File A A A A A A A A A
File B B B B B
File C C C
File D D D

So the order will be: A, B, A, C, A, B, A, D, A, B, A, C, A, B, A, D, ...

As you can see:

  • A will be overwritten with every 2nd save
  • B will be written every 4th
  • C 8th
  • D 16th ...

The generic order is: 2 n-1.

Files can be restored from 1, 2, 4, 8, 16, ..., 2 n-1 saves ago!

Working with 11 files will result in 512 saves, before K is overwritten the first time. Then it will need another 1024 saves until it is overwritten again.

Eg: Starting with A, if you save your file twice a minute for eight hours, you will still have not overwriten K. K is save #1024 and 2 * 60 * 8 = 960.

The Modification

With the very first save, the plugin detects a new wiki, an "out of order" backup will be created. It looks like this: wiki-name(2019-08-13T11-54-07-179Z).html

News and History

  • Information about the latest version can be found at: News/History
  • Older versions: TODO

Links

[1] https://tiddlywiki.com/#GettingStarted
[2] Overview Releases

License

Copyright Mario Pietsch 2017-2020

CC-BY-NC-SA ... https://creativecommons.org/licenses/by-nc-sa/4.0

file-backups's People

Contributors

bryanpedini avatar furicle avatar pmario avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

file-backups's Issues

Doesn't work if download path is less than two levels deep

If I put the download path here:

D:\data\Wikis<wiki dirs>

Then I can save

D:\data\Wikis\ABC\myfile.html

But if the download dir is here:

D:\data\ or D:\

it won't save.

Objective: Create a Firefox personal profile JUST for tw use, where the download folder is the root folder, enabling the ENTIRE directory structure to be used for TW files.

Better error handling for backpus directory setting

see: https://groups.google.com/d/msg/tiddlywiki/rar4JbKs740/zeT2LOSLCAAJ

On another issue, what path can you give fb to tell it to save in an absolute location?

OK I see. Absolute position is forbidden by the browser web-extension API.

    That's not possible (because of browser security concerns) and it's not needed.


Ok, I just realized that I can use ../.. to back out of the current directory. So that works. I don't need to send the backups to a different physical drive. Just one single point where they're not part of the weekly backup plan.

Important for those who don't use a root directory as the browser download dir.

As long as you stay inside the "browser downloads" directory "area" a ../twBackups as the "Backup directory" will work.

BUT as soon as you "leave" the "area" you will see this message in the browser dev Console (F12): save-wiki error: Error: "filename must not contain back-references"

I didn't think about this setting, that's why there is no user facing message atm. So if the setting is wrong there is no warning and NO BACKUPS

I will create a bug-report at github for this.

Doesn't work on new Firefox (v71.0)!

Hi,

It doesn't work on the new Firefox (v71.0). I'm getting download failed every time I try to save.
I use Firefox portable (from PortableApps).

Thanks.

Barely working with FF69.0.2

I'm using PVHL's Woas project and File Backups does not save the file unless I open Preferences, save the preferences, and reload the page. Even then it doesn't always work. Having the same behavior with SaveTiddlers.

discussion: Extending the backup strategy

@jerojerojeroppi

quote from #34 (comment)

Btw, one reason why I love this addon is because I find its backup scheme outstanding. Other solutions just create backup folders that grow and grow with no limit.

Thx. ... That's 1 reason why I did create it that way. It's the exact same schema that can be used by magnetic tape based backup systems. They have been expensive and you can use/overwrite them limited times.

The browser web-extension API doesn't allow devs to read the content of any directory. So it's not possible to read "back" the number of existing backup files, to delete or overwrite them. ... That's why I needed a reliable "overwrite" strategy, that provides the possibility for users to "restore" certain stages of a wiki and uses a predictable amount of space.

With fb 0.4.0 I started to save the very first version of a wiki with an exact timestamp.

There is also an idea, to save additional "milestone" backups. Eg: A "special" save button, that allows the user to create an extra backup when a wiki reaches a "working state" or a new internal "version number" ...

There could be a mechanism, that allows the user to immediately open such a milestone save. .. To see if everything works as expected. So you can be sure it's a working version.

The milestones can be used in addition to the A,B,C.. backups for "disaster recovery". Or if the user uses a "low backup number" and completely messed up all the A,B,C,... backups

I'm thinking about a new directory eg: twbackups/test.html.milestones on the same level as twbackups/test.html directory.

This makes it possible to immediately see, if a wiki has milestone backups.

What do you think?

Fail to work with FF70

Hi,

When firefox was upgraded to release 70.0 I started to get the following error whenever I started my tiddlywiki page.

"file-backups" has detected another plugin named: "file-backups"
At the moment only 1 save mechanism can be active at once.
We will temporarily deactivate the functionality, until the problem is resolved!

Can you please help?

Thanks,
Miguel

Disabled after Firefox restart

Starting a few days ago, file-backups does not work any longer when I restart Firefox. While the "Enable backups" is still ticked on, Firefox offers to save the TiddlyWiki, instead of making a backup.

Workaround: When I disable and enable the AddOn, then all is fine - until the next browser restart.

FF58.0, WIn10, file-backups 0.3.4

Feature Request

Hi Mario.

Would it be possible to enhance file-backups so that I can load my TiddlyWiki from a WebDAV location and save backups in my download folder nevertheless?

I simply tried it, not yet completely understanding what file-backup does ;)

Of course nothing was saved.

file-backups fails to opt out of "Always ask you where to save files"

Something about file-backups is causing it to fire off two or three Save As dialogs on my system for each TiddlyWiki Ctrl+S while other addons like Web ScrapBook (and my own experiments) get away with streaming a veritable flood of un-prompted files to within my downloads folder without a single prompt.

(On the exact same browser version and profile. When file-backups didn't work as expected, I tried triggering Web ScrapBook to check if something had changed without me noticing.)

Save Button does not work in Firefox 63

If I activate the plugin, I cannot save my Tiddliwiki at all. Neither the file is updated nor a download window. Disable this plugins, allow me to see the download window.

I use Firefox 63 (64 bit) and Fedora 29.

Save file prompt on autosave in Firefox 59

Hi, I enjoy using this addon for saving my Tiddlywiki files conveniently in Dropbox, but recently the file prompt pops up on save as shown in the gif:

twsave

As you can see, it pops up twice: once to save the original file, and again to save a backup file.
I'm wondering if you had some ideas about what could be going on?

Currently I am running File Backups 0.3.5 on Firefox 59 on Windows 10. The Tiddlywiki file itself is 5.1.13. If there's anything else I can do to help debug, please let me know. Thanks for your work on this project.

Firefox changes the absolute path, which breaks file-backups

Using Firefox 85, FLATPAK VERSION, on Ubuntu 21.04 Hirsute (because the DEB version is currently broken). This version of Firefox, which apparently is gaining traction, is run inside of a container. It has changed the way it describes paths on the operating system. Therefore, where once we had:

/home/user/Documents/WikiDirectory/wiki.htm

we now have:

/run/user/1000/doc/99999abc/Documents⁩/WikiDirectory/wiki.htm,

where "99999abc" is a random hexadecimal number. This is a valid absolute path, but because it is run through the virtual filesystem and not the absolute Linux file tree, it breaks File Backups.

I guess this is a bit of beta testing, because Hirsute is not due out for a couple months. But at the same time, Flatpak is up and running. It is the suggested method of install for Firefox on Linux outside of a repository. And it alone works, whereas the DEB version and the gzipped version (and, old news, the PortableApps version under Wine) do not work on my OS. So I hope very much you have a fix for this, because it is coming your way.

Thanks

Consistent "It's not possible to save changes." when I didn't change anything on my end

A few weeks ago, I started getting consistent "It's not possible to save changes." messages on my TiddlyWiki Classic wikis. (Yeah, I know. I was lazy and assumed whoever broke it would fix it soon.)

I haven't changed anything, and I have restarted Firefox since then, so I can only assume some changed pushed by either Mozilla or you broke something.

I don't know whether it also affects TiddlyWiki 5 because I just can't muster the willpower to figure out how to port the TiddlyWiki classic theme to it... let alone making enough sense of the internals to port my prefered extensions to it. (I'd much rather just have someone backport the Ctrl+S fallback saving functionality.)

Plug In Text has erroneous link

Very minor bug.

When looking at the plug in after installation, there's a link on the text #1024 because github thinks it's an issue number.

image

Error detecting itself?

image

After a complete system reboot (Windows Updates)

Note this is with version 0.1.2 - may no longer apply
Only one copy in add-ons, and it doesn't show as disabled?

External links shouldn't have duplicate detection...

If you have an external link in TW

e.g. [ext[TWC users|file:///c/users/santa/documents/naughty/]]

Clicking once opens the location in another tab as expected.
Clicking that link a second time (or from a different TW) triggers the duplicate warning.
image

I don't think that's appropriate when the link is to something external?

Add Information about using hard links to relocate folders

It seems like the biggest short coming of file-backups vs TiddlyFox is the forced location for files.

I think it's possible to use hard links to partially work around that.

It would be nice if we documented that proceedure not only in the README, but in the plug in itself.

I was hoping the plug in "knows" the location of the downloads folder, and the operating system it's running under. That way we could have something like a button where the Dashboard button is now, that opens a dialog box giving instructions on the mklink or ln syntax that's correct for that users computer...

Save button remains red even if save is succesfull

Hi @pmario

I noticed something strange lately and I think it's something related to the latest version (modifications).
The save button in TiddlyWiki remains red even the file is saved (downloaded) successfully. I'm using Firefox v57.0.2 (64-bit) and TiddlyWiki v5.1.15 (latest).

Thanks and keep up the good work.

TW extension

Issue

TW file named xxx.html: file-backups performs as expected
TW file named xxx.hta: file-backups does not work, the "save file"/"download dialog bx appears

Configuration

TW Version 5.1.15 and 5.1.13 affected (probably not relevant)
file-backups 0.3.5
FF 58.0.2 (64-Bit)
FF config: Save downloads in ~/Downloads
OS: Linux 4.4.114-42-default x86_64 openSUSE 42.3 (x86_64)
Qt: 5.10.0
KDE: 5.43.0
Plasma: 5.12.3

Setup

twBackups created in a directory linked to ~/Downloads

Expected Behavior

Allow arbitrary extensions or issue a warning

Remark

I used the extension .hta from the early beginnings of using TW classic. Previous use of TW with file-backups worked with this extension. Unfortunately cannot provide info on previous use since several updates of FF (and probably file-backups) occurred since last use of one of my TWs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.