You are here

function backup_migrate_exec in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.2 backup_migrate.module \backup_migrate_exec()
  2. 8.3 backup_migrate.module \backup_migrate_exec()
  3. 7.3 backup_migrate.module \backup_migrate_exec()
  4. 7.2 backup_migrate.module \backup_migrate_exec()

Execute a command line command. Returns false if the function failed.

6 calls to backup_migrate_exec()
backup_migrate_destination_filesource::_backup_to_file_cli in includes/sources.filesource.inc
Backup from this source.
backup_migrate_destination_filesource::_restore_from_file_cli in includes/sources.filesource.inc
Restore to this source.
backup_migrate_files_destination_archivesource::_backup_to_file_cli in includes/sources.archivesource.inc
Backup from this source.
backup_migrate_filter_compression::_backup_migrate_gzip_decode in includes/filters.compression.inc
Gzip decode a file.
backup_migrate_filter_compression::_backup_migrate_gzip_encode in includes/filters.compression.inc
Gzip encode a file.

... See full list

3 string references to 'backup_migrate_exec'
backup_migrate_destination_filesource::_backup_to_file_cli in includes/sources.filesource.inc
Backup from this source.
backup_migrate_destination_filesource::_restore_from_file_cli in includes/sources.filesource.inc
Restore to this source.
backup_migrate_files_destination_archivesource::_backup_to_file_cli in includes/sources.archivesource.inc
Backup from this source.

File

./backup_migrate.module, line 1631
Create (manually or scheduled) and restore backups of your Drupal MySQL database with an option to exclude table data (e.g. cache_*)

Code

function backup_migrate_exec($command, $args = array()) {
  if (!function_exists('exec') || ini_get('safe_mode')) {
    return FALSE;
  }

  // Escape the arguments
  foreach ($args as $key => $arg) {
    $args[$key] = escapeshellarg($arg);
  }
  $command = strtr($command, $args);
  $output = $result = NULL;

  // Run the command.
  exec($command . ' 2>&1', $output, $result);
  return $result == 0;
}