Backup Fails While Dumping Directory Tree

anonymous wrote on Friday, January 13, 2012:

Utilizing the backup process via “Administration > Backup” has been giving me some trouble. The process suddenly decided to hang at “Dumping OpenEMR web directory tree…” There are no error messages displayed, just the visual cue that the spinning progress indicator (on the Firefox browser tab) stops immediately after displaying the above message. This problem seemed to come out of nowhere. Backup was working fine and now this.

I am able to complete a manual back up as per http://open-emr.org/wiki/index.php/Backing_Up_Using_the_Built_In_Tools.

I assume I should be looking at the following code to figure why the process is being halted??

(/interface/main/backup.php)

if ($form_step == 4) {
  $form_status .= xl('Dumping OpenEMR web directory tree') . "...<br />";
  echo nl2br($form_status);
  $cur_dir = getcwd();
  chdir($webserver_root);
  // Select the files and directories to archive.  Basically everything
  // except site-specific data for other sites.
  $file_list = array();
  $dh = opendir($webserver_root);
  if (!$dh) die("Cannot read directory '$webserver_root'.");
  while (false !== ($filename = readdir($dh))) {
    if ($filename == '.' || $filename == '..') continue;
    if ($filename == 'sites') {
      // Omit other sites.
      $file_list[] = "$filename/" . $_SESSION['site_id'];
    }
    else {
      $file_list[] = $filename;
    }
  }
  closedir($dh);
  $arch_file = $BACKUP_DIR . DIRECTORY_SEPARATOR . "openemr.tar.gz";
  if (!create_tar_archive($arch_file, "gz", $file_list))
    die(xl("An error occurred while dumping OpenEMR web directory tree"));
  chdir($cur_dir);
  $auto_continue = true;
}

Any suggestions?

anonymous wrote on Friday, January 13, 2012:

This is version 4.1.0 (5) installed on Ubuntu 10.04 LTS

ajperezcrespo wrote on Friday, January 13, 2012:

Yup got the same exact situation here.
In fact the Directory dump stops at exactly 1GB.
Did not have this problem with v4.0.

I increased memory and time outs in php but still a no go.

Alfonso

anonymous wrote on Sunday, January 15, 2012:

Fix in v4.1.0 (6) patch cleaned this up for me. Big thanks to yehster for the contribution!

ajperezcrespo wrote on Sunday, January 15, 2012:

Ok I’ve applied the patch (6) but now the backup file (openemr.tar.gz)  stops at 4.4 GB no download is sent 
How big are your backups mcgillicuty?

Alfonso

anonymous wrote on Monday, January 16, 2012:

Total archive (emr_backup.tar) is ~1.6 GB

ajperezcrespo wrote on Tuesday, January 17, 2012:

Hi
The backup file generated is 4.4GB yet if I check the file it seems fine.

With Chrome only downloads a corrupt 397 MB file
With Firefox it never gets beyond Dumping Database.
Havent Tested with IE I am using an ubuntu workstation

Thoughts?
FYI:Server is also ubuntu box.

bradymiller wrote on Tuesday, January 17, 2012:

Hi,
That’s an awfully large file; maybe we need to incorporate a torrent server within OpenEMR :slight_smile: With files of that size, wondering if may need to do the backup outside of OpenEMR:
http://open-emr.org/wiki/index.php/OpenEMR_Backup_Tools
-brady