Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Automated JATOS backups

I've seen in several places that it's risky to do a simple rsync / tar / cp of a running JATOS folder to perform backups. I'm a bit confused by this -- how reading from a folder could corrupt the database -- but that's what's out there. If I want to do automated backups to help ensure that I don't lose any data should a drive die, is there a reasonable scheme for this then? Is it just to run on a filesystem that allows snapshots and to use that as the source of the backup? If I'm not on such a filesystem, I'm out of luck?

Comments

  • Having looked at the H2 database info a bit, it seems there are a few options. While there may be a way to do it live without snapshots, you can certainly start / backup / stop. One option I had Qwen code up uses the org.h2.tools.Backup call. It takes about a minute to do the full thing and ends up with a 640Mb .zip file (we've run a few subjects... raw, the jatos.mv.db is 3.4G).

    Is there an advantage to doing it this way vs stop, copy, start?

  • In my experience the easiest is, like you said, start / backup / stop. I do this often. You probably saw this on H2 docs (https://www.h2database.com/html/features.html): "To backup data while the database is running, the SQL commands SCRIPT and BACKUP can be used.". But I've never tried, never saw the need. The only advantage I see is that you don't have to stop JATOS to do the update.

    On a different page, I'd recommend, if you use JATOS for more than just a couple studies, to connect it to a MySQL/MariaDB database. There backing up is easy and the database is very robust.

Sign In or Register to comment.