function backup_migrate_destination_nodesquirrel::save_file

cis7 backup_migrate_destination_nodesquirrel::save_file($file, $settings)
cle7 backup_migrate_destination_nodesquirrel::save_file($file, $settings)
elmsmedia7 backup_migrate_destination_nodesquirrel::save_file($file, $settings)
icor7 backup_migrate_destination_nodesquirrel::save_file($file, $settings)
meedjum_blog7 backup_migrate_destination_nodesquirrel::save_file($file, $settings)
mooc7 backup_migrate_destination_nodesquirrel::save_file($file, $settings)

Save to the NodeSquirrel destination.

Overrides backup_migrate_destination::save_file


sites/all/modules/ulmus/backup_migrate/includes/, line 184
Functions to handle the NodeSquirrel backup destination.


A destination for sending database backups to the NodeSquirel backup service.


function save_file($file, $settings) {
  if ($destination = $this->_get_destination()) {
    srand((double) microtime() * 1000000);

    $filename = $file->filename();
    $filesize = filesize($file->filepath());
    $ticket = $this->_xmlrpc('backups.getUploadTicket', array($destination, $filename, $filesize, $file->file_info));

    if ($ticket) {

      $url = $ticket['url'];

      // If the ticket requires authentication add our username/password to the url.
      if (!empty($ticket['auth']) && $ticket['auth'] = 'basic') {
        $parts = parse_url($ticket['url']);
        list($parts['user'], $parts['pass']) = $this->get_user_pass();
        $url = $this->glue_url($parts, FALSE);

      $out = $this->_post_file($url, 'POST', $ticket['params'], $file);

      if ($out->code == 200) {
        // Confirm the upload.
        $confirm = $this->_xmlrpc('backups.confirmUpload', array($destination, $filename, $filesize));

        if ($confirm['success']) {
          // Set a message with a link to the manage console.
          $url = variable_get('nodesquirrel_manage_url', '') . '/backups/' . $this->_get_destination();
          _backup_migrate_message('Your backup has been saved to your NodeSquirrel account. View it at !account', array('!account' => l($url, $url)));

          return $file;
        else {
          _backup_migrate_message('The backup file never made it to the NodeSquirrel backup server. There may have been a network problem. Please try again later');
      else {
        $error = !empty($out->headers['x-bams-error']) ? $out->headers['x-bams-error'] : $out->error;
        _backup_migrate_message('The NodeSquirrel server returned the following error: %err', array('%err' => $error), 'error');
    else if ($err = xmlrpc_error()) {
      // XMLRPC errors are already handled by the server function below.
    else {
      _backup_migrate_message('The NodeSquirrel server refused the backup but did not specify why. Maybe the server is down.');
  return NULL;



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.