Scripts for Backing Up TiddlyHost

Right now you could probably scrape out a site list. (I’ll try it and share some example code). In future perhaps we’ll have a JSON end point to provide a list of all your sites.

2 Likes

OK, I’m late to the game here, partly because your OP mentions MacOS, but I knew nothing about Powershell… except what I see now by googling it, and getting invited down rabbit-holes of instructions about how to set it up; the “how-to” pages all seem to presuppose familiarity with stuff that’s greek to me.

If I’m on MacOS, and have access to the terminal, can I run some version of your script to grab a download of each of my projects? Can you point me to a current step-by-step on how to download/enable powershell — also, ideally not just landing me at a github maze where it’s opaque (to a non-coder) how to find/download what I need)?

And on the details of your script: Does it work smartly by prioritizing the most recently-changed projects, and bypassing downloads that would be identical to what’s already in my backups archive?

Many thanks!

I’m not a Mac person, but it looks like you might be able to run the original script. Apparently Mac can run shell-like scripts. The question is whether it has all the tools the script needs – especially the curl executable. The actual instructions seem to be a matter of setting the rights to the script (which is what you also have to do on linux).

I would think that this is the authoritative resource for installing Powershell on Mac:

Ok, and looking at that page, it appears that Mac must have the curl executable available.

I guess I would try the “brew” instructions first, and see if they work.

That would be a cool future script. Currently, the script works blindly, not knowing anything about the status of the site. Possibly the script that @simon might come up with could do that.

It’s sort of a “Better to have an umbrella with holes than no umbrella at all” kind of script.

Here’s a new “download all my sites” example script.

Actually it does use a newly added JSON end point to avoid needing to scrape the html.

FWIW if you’re using a mac you should be able to use the example scripts just as they are, i.e. no need for PowerShell unless you have a special reason why you want to use that.

There’s no “smart” downloading/backups at this stage, but such a thing would be possible. A simple approach might be to download and then delete the downloaded file if it’s the same as previously downloaded file.

Hi folks,

I just wanted to let you know about my “old” backup scripts used for tiddlyspace, which sadly does not exist anymore.


I did have a short look at both source download helper source codes and saw, that they both start to download, without informing the user what’s going on.

So I thought it would be nice to have 3 steps.

  1. Download some meta data, save it to files and let the user know what’s going on
  2. Tell the user it may take some time to download and ask if they want to continue
    2.a User may say No and first may want to modify the list of files they really want / need.
  3. If they want to go on. Use the meta data files and download according to those files

Step 2 may not seem to be necessary, but I tell you, if there are 22000+ spaces you can choose from, this info is important :wink:

I did create 2 backup-scripts for tiddlyhost, 8 years ago. Both of them follow this schema.

The repos are at:

Just some thoughts.
Mario

1 Like

I can follow your link and see that there’s code there. If I download it, it’s just a text file… I feel like I have been generously handed the menu to a restaurant, but the menu is in a language I cant read.

It’s not crystal clear to me what steps are involved in either getting the terminal to execute commands that engage with / activate this script, or what steps are needed to give this downloaded file the right extension to make it behave as an executable.

And does this text/script need to be directly edited so that I’m swapping in my custom username and password strings… (and at exactly which places would I do that)? Or if I set it up right, is it just designed to prompt me when it runs?

Sorry I need hand-holding here; my interaction with terminal and scripts is very much on a “simon-says do X” :wink: step-by-step basis.

In the link I provided in my prior post, it gave instructions for how to run shell scripts in Mac.

An overview of the steps I would try. Talking about Simon’s new script.

  • Download the file to a directory you want to use.
  • Open a terminal and move to that directory
  • The downloaded file should have an extension of .sh. If it doesn’t, rename it accordingly
  • Make the file executable. The form I’ve always used is

chmod 744 <file name>

Run the file:

./<name of downloader script> <user name> <password>

Edit - notes: The little ./ in front of the name is important, at least in the systems I’ve always used.

I’ll write up a howto and put it at Home · simonbaird/tiddlyhost Wiki · GitHub .

2 Likes