Backup does not download

rdh61 wrote on Wednesday, September 19, 2012:

Hi,

Crunchbang Linux 10.
Old HP omnibook with 256 MB RAM.
Iceweasel browser.

When I try to make a backup from the browser interface, the process stalls after:

“Dumping OpenEMR database…
Dumping OpenEMR web directory tree…”

But the backup never downloads, even if I wait for 30 minutes.

I have also tried to run the backup script, backup_oemr.sh, but I get the following output:

“backup_oemr.sh: 21: cannot create /var/tmp/backups/2012-09-19.sql.bak: Directory nonexistent
bzip2: Can’t open input file /var/tmp/backups/2012-09-19.sql.bak: No such file or directory.
backup_oemr.sh: 27: cannot create /var/tmp/backups/2012-09-19postgres.bak: Directory nonexistent
backup_oemr.sh: 27: pg_dumpall: not found
bzip2: Can’t open input file /var/tmp/backups/2012-09-19postgres.bak: No such file or directory.
tar: Removing leading `/’ from member names
tar (child): /var/tmp/backups/2012-09-19openemr.tar.bzip2: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: /var/tmp/backups/2012-09-19openemr.tar.bzip2: Cannot write: Broken pipe
tar: Error is not recoverable: exiting now
backup_oemr.sh: 38: mkisofs: not found
backup_oemr.sh: 41: cdrecord: not found”

It is essential for me to be able to create backups. Please help.

Many thanks.

rdh61 wrote on Friday, September 21, 2012:

Bump.

I have seen another thread on this at: https://sourceforge.net/projects/openemr/forums/forum/202505/topic/4919698?message=11000256

I have tried the suggestion of increasing the max_execution_time in php.ini. The backups still do not download.

I have also tried to run the backup script, backup_oemr.sh, but it gives errors (see my original post).

Please let me know what additional information would be needed to help you to help me, and above all, PLEASE WALK ME THROUGH THE STEPS FOR OBTAINING IT.

Or perhaps more simply, is there a patch or updated backup script which DOES work?

HELP!!!

bradymiller wrote on Saturday, September 22, 2012:

Hi,
Discussion on this (and instructions to begin debugging this issue) can be found here:
https://sourceforge.net/projects/openemr/forums/forum/202505/topic/4919698
-brady
OpenEMR

rdh61 wrote on Saturday, September 22, 2012:

Yes, thank you. I’ll post here my responses to all the suggestions on that thread, then we can move all further discussion there.

(1) Anything showing up in the php error log or the javascript error log?

I don’t know where to find these.

(2) Is it happening on all browsers or a specific one?

All browsers.

(3) Is the script timing out?

I don’t know how to find this out.

(4) I made some changes related to the backup process in January. https://github.com/openemr/openemr/commit/12103ca25f93247bafdd25f7f51eedd3963bdb0f Not sure if those changes address your specific problems though.

The set_time_limit(0); code was missing from line 36 (line 36 was empty). I added it. This solved the problem.

(5) I wonder if it’s related to a timeout from apache: http://httpd.apache.org/docs/2.0/mod/core.html#timeout

I have referred to the link but it is not clear to me from this whether that may be the case or what to do about it.

(6) In the php.ini file (just search for it) increase the max_execution_time from its current setting to something a little more extreme like 1080 - this gives enough time and the back up will work fine.

I tried this. No change in behaviour.

(7) You need to implement a automated backup script… It’s not hard, you need only use mysqldump to copy the database out to text and and kind of tar, zip, copy, rsync, xcopy to make a snapshot of it all and put it somewhere other than the same machine. There is an linux example in contribs/util called backup_oemr.sh, would be easy to do a windows cmd shell version of it.

I ran backup_oemr.sh. Errors as in output in my original message.

(8) Curious to know in both Jeff and rdh61 cases the files/directories and sizes you see at /tmp/openemr_web_backup after running the backup script (note the files will keep getting bigger while the script is running, so wait until files stop growing)

Answer at https://sourceforge.net/projects/openemr/forums/forum/202505/topic/4919698

Thanks.