REST in rest

Dear Sébastien,

there are multiple ways to make a backup, but it would be most nice to do this when I am sure no other transaction is running at the moment; not kill off others retreival or store before i stop the orthanc service for backup. And even if I only dump the 'index' db and copy the files in db-v4, i'd rather wait for a sure quiet spot.

https://docs.google.com/spreadsheet/pub?key=0Ao5aRMxCX2hldEJadzVUaWFmNW5QTWhrYTI3UHMzdXc&single=true&gid=16&output=html
contains all the rest calls, would you consider adding one to tell me the amount of transactions going on at the moment, or maybe even which transactions are going on at the moment?

The catch 22 is ofcourse that such a call would in itself be a call, but very shortlived.

Regards,

  Vincent

This is a very dangerous way to approach backups as you cannot guarantee that a transaction hasn’t begun since you got the response back from Orthanc. Your main concern is really about the database (sqllite) and there is good information about how to do it safely here:

https://www.sqlite.org/backup.html

Orthanc should implement a backup mechanism that uses the sqllite backup API and either expose a REST call to trigger it or do perhaps do it automatically via a schedule.

Chris

Good point, thank you for the link to the backupAPI.

Hello,

Currently, before Orthanc implements other database back-ends than SQLite, the only reliable way to backup Orthanc consists in stopping it, waiting for the process to go away, archiving the content of the “OrthancStorage” folder, then restarting Orthanc.

Using an embedded database engine such as SQLite comes with great advantages in the ease of deployment, but does not provide advanced mechanisms such as those available in advanced database engines like PostgreSQL/MySQL.

HTH,
Sébastien-

Ease of deployment is worth something as well :slight_smile:

For now, this is the script i use for backing up.

orthanc-backup.sh (1.44 KB)

It is meant for use in cron, but you can also run in by hand.
Giving it any argument will give debugging info (e.g. './orthanc-backup.sh debug')

Thanks for sharing your backup script!

I have just added it to the “Orthanc Contributed” git repository:
https://github.com/jodogne/OrthancContributed/tree/master/Scripts/Backup

Cheers,
Sébastien-