public function remote_send($destination_id, $backup_file, $trigger, $send_importbuddy = false, $delete_after = false) { pb_backupbuddy::set_greedy_script_limits(); if ('' == $backup_file && $send_importbuddy) { pb_backupbuddy::status('message', 'Only sending ImportBuddy to remote destination `' . $destination_id . '`.'); } else { pb_backupbuddy::status('message', 'Sending `' . $backup_file . '` to remote destination `' . $destination_id . '`. Importbuddy?: `' . $send_importbuddy . '`. Delete after?: `' . $delete_after . '`.'); } if (!isset(pb_backupbuddy::$options)) { pb_backupbuddy::load(); } if (!class_exists('backupbuddy_core')) { require_once pb_backupbuddy::plugin_path() . '/classes/core.php'; } backupbuddy_core::send_remote_destination($destination_id, $backup_file, $trigger, $send_importbuddy, $delete_after); }
public function deploy_push_sendFile($state, $sendFile, $sendPath, $sendType, $nextStep, $delete_after = false) { $destination_settings =& pb_backupbuddy::$options['remote_destinations'][$state['destination_id']]; $destination_settings['sendType'] = $sendType; $destination_settings['sendFilePath'] = $sendPath; $destination_settings['max_time'] = $state['minimumExecutionTime']; if (false === backupbuddy_core::send_remote_destination($state['destination_id'], $sendFile, 'Deployment', $send_importbuddy = false, $delete_after, $identifier = $this->_backup['serial'] . '_' . md5($sendFile . $sendType), $destination_settings)) { $sendFile = ''; // Since failed just sent file to blank so we can proceed to next without waiting. } $this->deploy_sendWait($state, $sendFile, $sendPath, $sendType, $nextStep); return true; }
// END TOUR. // Check if performing an actual migration now. If so then load file and skip the rest of this page. if (pb_backupbuddy::_GET('callback_data') != '' && pb_backupbuddy::_GET('callback_data') != 'importbuddy.php') { require_once '_migrate.php'; return; } // Handle remote sending ImportBuddy. if (pb_backupbuddy::_GET('callback_data') == 'importbuddy.php') { pb_backupbuddy::alert('<span id="pb_backupbuddy_ib_sent">Sending ImportBuddy file. This may take several seconds. Please wait ...</span>'); pb_backupbuddy::flush(); pb_backupbuddy::anti_directory_browsing(backupbuddy_core::getTempDirectory(), $die = false); $importbuddy_file = backupbuddy_core::getTempDirectory() . 'importbuddy.php'; // Render ImportBuddy to temp location. backupbuddy_core::importbuddy($importbuddy_file); if (file_exists($importbuddy_file)) { $response = backupbuddy_core::send_remote_destination($_GET['destination'], $importbuddy_file, $trigger = 'manual'); } else { pb_backupbuddy::alert('Error #4589: Local importbuddy.php file not found for sending. Check directory permissions and / or manually migrating by downloading importbuddy.php.'); $response = false; } if (file_exists($importbuddy_file)) { if (false === unlink($importbuddy_file)) { // Delete temporary ImportBuddy file. pb_backupbuddy::alert('Unable to delete file. For security please manually delete it: `' . $importbuddy_file . '`.'); } } if ($response === true) { ?> <script type="text/javascript"> jQuery( '#pb_backupbuddy_ib_sent' ).html( 'ImportBuddy file successfully sent.' ); </script>
function send_remote_destination($destination_id, $delete_after = false) { pb_backupbuddy::status('details', 'Sending file to remote destination ID: `' . $destination_id . '`. Delete after: `' . $delete_after . '`.'); $response = backupbuddy_core::send_remote_destination($destination_id, $this->_backup['archive_file'], '', false, $delete_after); if (false === $response) { // Send failure. $error_message = 'BackupBuddy failed sending a backup to the remote destination "' . pb_backupbuddy::$options['remote_destinations'][$destination_id]['title'] . '" (id: ' . $destination_id . '). Please verify and test destination settings and permissions. Check the error log for further details.'; pb_backupbuddy::status('error', 'Failure sending to remote destination. Details: ' . $error_message); backupbuddy_core::mail_error($error_message); } }
function send_remote_destination($destination_id, $delete_after = false) { pb_backupbuddy::status('details', 'Sending file to remote destination ID: `' . $destination_id . '`. Delete after: `' . $delete_after . '`.'); pb_backupbuddy::status('details', 'IMPORTANT: If the transfer is set to be chunked then only the first chunk status will be displayed during this process. Subsequent chunks will happen after this has finished.'); $response = backupbuddy_core::send_remote_destination($destination_id, $this->_backup['archive_file'], '', false, $delete_after); if (false === $response) { // Send failure. $error_message = 'BackupBuddy failed sending a backup to the remote destination "' . pb_backupbuddy::$options['remote_destinations'][$destination_id]['title'] . '" (id: ' . $destination_id . '). Please verify and test destination settings and permissions. Check the error log for further details.'; pb_backupbuddy::status('error', 'Failure sending to remote destination. Details: ' . $error_message); backupbuddy_core::mail_error($error_message); } }