You are here

function backup_migrate_files_destination_filesource::backup_to_file in Backup and Migrate Files 7

Backup from this source.

File

includes/destinations.filesource.inc, line 94
A destination type for saving locally to the server.

Class

backup_migrate_files_destination_filesource
A destination type for saving locally to the server.

Code

function backup_to_file($file, $settings) {
  if ($this
    ->check_libs()) {
    $excluded_paths = empty($settings->filters['exclude_filepaths']) ? '' : $settings->filters['exclude_filepaths'];
    $files = $this
      ->get_files_to_backup($this
      ->get_location(), $settings, $this
      ->get_excluded_paths($excluded_paths));
    if ($files) {
      $file
        ->push_type('tar');
      $gz = new Archive_Tar($file
        ->filepath(), false);
      $gz
        ->addModify($files, $file->name . '/files', $this
        ->get_location());
      return $file;
    }
    backup_migrate_backup_fail('No files available.', array(), $settings);
    return FALSE;
  }
  return FALSE;
}