1

I am using Ubuntu 18.04.4 LTS and I've recently upgraded from Firebird 2.5 to Firebird 3.0.

Prior to upgrading, I was restoring my local database with the following unzip&replace command:

zcat /var/www/temp/<database name><backup timestamp>.gbak.gz | gbak -rep -v stdin /database/<database name>.fdb -user <username> -pass <password>

This did the whole job in one step and I dig that sort of thing. However, after upgrading Firebird I have discovered that FlameRobin (version 0.9.2.1850) will not connect to the updated database. The error message (to help others who may be Googling) is:

Engine Code: 335544344
Engine Message: I/O error during "open" operation for file "/database/.fdb"
Error while trying to open file
Permission denied.

And my CodeIgniter project complains:

Unable to connect to your database server using the provided settings.

To solve this, I change the <database name>.fdb file's owner and group to firebird and firebird then everything is sweet. However I am doing this in two steps ...ugh, lame right? ...I know.

So I am wondering if I can execute something like Change folder permissions and ownership in the same line as my above unzip&replace command?

My system admin fu is not terribly impressive, so I haven't dared to get too crazy with my attempts, but I figure this should be a relatively basic task for those with experience in such things.

p.s. Ideally, I'd like it if I never had to change the owner settings on every restore, so if there is a way to do that -- that would be even better.

1 Answer 1

1

After referring to

Which one is better: using ; or && to execute multiple commands in one line?

I added: && sudo chown firebird:firebird /database/<database name>.fdb to my command to form:

zcat /var/www/temp/<database name><backup timestamp>.gbak.gz | gbak -rep -v stdin /database/<database name>.fdb -user <username> -pass <password> && sudo chown firebird:firebird /database/<database name>.fdb

This successfully changed the ownership settings in one line.

If there is a better practice I am happy to here it and why.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.