function backup_migrate_drush_backup in Backup and Migrate 7.3
Same name and namespace in other branches
- 8.2 includes/backup_migrate.drush.inc \backup_migrate_drush_backup()
- 8.3 includes/backup_migrate.drush.inc \backup_migrate_drush_backup()
- 6.3 includes/backup_migrate.drush.inc \backup_migrate_drush_backup()
- 6.2 includes/backup_migrate.drush.inc \backup_migrate_drush_backup()
- 7.2 includes/backup_migrate.drush.inc \backup_migrate_drush_backup()
Backup the default database.
1 string reference to 'backup_migrate_drush_backup'
- backup_migrate_drush_command in includes/
backup_migrate.drush.inc - Implements hook_drush_command().
File
- includes/
backup_migrate.drush.inc, line 97 - Drush commands for backup and migrate.
Code
function backup_migrate_drush_backup($source_id = 'db', $destination_id = 'manual', $profile_id = 'default') {
require_once dirname(__FILE__) . '/destinations.inc';
require_once dirname(__FILE__) . '/profiles.inc';
require_once dirname(__FILE__) . '/sources.inc';
// Set the message mode to logging.
_backup_migrate_message_callback('_backup_migrate_message_drush');
if (!backup_migrate_get_source($source_id)) {
_backup_migrate_message("Could not find the source '@source'. Try using 'drush bam-sources' to get a list of available sources or use 'db' to backup the Drupal database.", array(
'@source' => $source_id,
), 'error');
return;
}
if (!backup_migrate_get_destination($destination_id)) {
_backup_migrate_message("Could not find the destination '@destination'. Try using 'drush bam-destinations' to get a list of available destinations.", array(
'@destination' => $destination_id,
), 'error');
return;
}
$settings = backup_migrate_get_profile($profile_id);
if (!$settings) {
_backup_migrate_message("Could not find the profile '@profile'. Try using 'drush bam-profiles' to get a list of available profiles.", array(
'@profile' => $profile_id,
), 'error');
return;
}
_backup_migrate_message('Starting backup...');
$settings->destination_id = $destination_id;
$settings->source_id = $source_id;
backup_migrate_perform_backup($settings);
}