We're Hiring!

Is the Omero backup script broken?

Having a problem deploying OMERO? Please ask new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

The OMERO.server installation documentation begins here and you can find OMERO.web deployment documentation here.

Is the Omero backup script broken?

Postby Magic » Sat Oct 05, 2013 11:13 am

On the web page http://www.openmicroscopy.org/site/support/omero4/sysadmins/server-backup-and-restore.html there is an example backup script.

I'm pretty sure this script is broken. It gives the illusion of working, but it's not actually backing up the database. :o

I believe the actual last line of the script should be:

su $DATABASE_ADMIN -c "pg_dump -Fc -f $OUTPUT_DIRECTORY/$DATABASE.$DATE.pg_dump $DATABASE"

for it to work.

I also think that you should get rid of the first line "#!sh" since that also won't work.

Am I misunderstanding something?
Magic
 
Posts: 19
Joined: Thu Sep 12, 2013 10:56 pm

Re: Is the Omero backup script broken?

Postby jmoore » Sat Oct 05, 2013 5:48 pm

Hi Sam,

how are you running the example command? The entire block was intended to be put into a file that will be run with administrative rights. Here's a local test:

Code: Select all
jamoore@blue:/tmp$ cat backup_script
#!sh
#!/bin/bash

DATE=`date '+%Y-%m-%d_%H:%M:%S-%Z'`
OUTPUT_DIRECTORY=/tmp/bak
DATABASE="ome2-44"
DATABASE_ADMIN="postgres"

mkdir -p $OUTPUT_DIRECTORY
chown -R $DATABASE_ADMIN $OUTPUT_DIRECTORY
su $DATABASE_ADMIN -c "pg_dump -Fc -f $OUTPUT_DIRECTORY/$DATABASE.$DATE.pg_dump"

jamoore@blue:/tmp$ sudo sh backup_script

jamoore@blue:/tmp$ ls -ltra /tmp/bak/
total 52
drwxrwxrwt 11 root     root     40960 Oct  5 19:45 ..
drwxr-xr-x  2 postgres root      4096 Oct  5 19:45 .
-rw-rw-r--  1 postgres postgres  1855 Oct  5 19:45 ome2-44.2013-10-05_19:45:56-CEST.pg_dump
jamoore@blue:/tmp$


Cheers,
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Is the Omero backup script broken?

Postby jmoore » Sat Oct 05, 2013 6:11 pm

Sam,

apologies. You're of course correct. The command completes successfully but on restore nothing is present in the DB. The final element "$DATABASE" was lost from the command. I've opened a PR to fix the problem: https://github.com/openmicroscopy/ome-documentation/pull/504

Many thanks for pointing this out!
~Josh
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany


Return to Installation and Deployment

Who is online

Users browsing this forum: No registered users and 1 guest