public/wordpress/wp-content/plugins/backupbuddy/controllers/cron.php
/* _process_destination_copy()
	 *
	 * Downloads a remote backup and copies it to local server.
	 *
	 * @param	$destination_settings		array 		Array of destination settings.
	 * @param	$remote_file				string		Filename of file to get. Basename only.  Remote directory / paths / buckets / etc should be passed in $destination_settings info.
	 * @param	$fileID						string		If stination uses a special file ID (eg GDrive) then pass that to destination file function instead of $remote_file. $remote_file used for calculating local filename.
	 * @return	bool									true success, else false.
	 *
	 */
_process_destination_copy()
Downloads a remote backup and copies it to local server.

@param       $destination_settings           array           Array of destination settings.
@param       $remote_file                            string          Filename of file to get. Basename only.  Remote directory / paths / buckets / etc should be passed in $destination_settings info.
@param       $fileID                                         string          If stination uses a special file ID  then pass that to destination file function instead of $remote_file. $remote_file used for calculating local filename.
@return      bool                                                                    true success, else false.
_process_destination_copy () Downloads a remote backup and copies it to local server . @param $destination_settings array Array of destination settings . @param $remote_file string Filename of file to get . Basename only . Remote directory / paths / buckets / etc should be passed in $destination_settings info . @param $fileID string If stination uses a special file ID then pass that to destination file function instead of $remote_file . $remote_file used for calculating local filename . @return bool true success else false .
function _process_destination_copy( $destination_settings, $remote_file, $fileID = '' ) {
		pb_backupbuddy::set_greedy_script_limits();
		if ( ! class_exists( 'backupbuddy_core' ) ) {
			require_once( pb_backupbuddy::plugin_path() . '/classes/core.php' );
		}
		require_once( pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php' );
		$local_file = backupbuddy_core::getBackupDirectory() . basename( $remote_file );
		if ( file_exists( basename( $local_file ) ) ) {
			$local_file = str_replace( 'backup-', 'backup_copy_' . pb_backupbuddy::random_string( 5 ) . '-', $local_file );
			$local_file = str_replace( 'snapshot-', 'snapshot_copy_' . pb_backupbuddy::random_string( 5 ) . '-', $local_file );
		}
		if ( $fileID != '' ) {
			$remote_file = $fileID;
		}
		if ( true === pb_backupbuddy_destinations::getFile( $destination_settings, $remote_file, $local_file ) ) {
			pb_backupbuddy::status( 'message', 'Success copying remote file to local.' );
			return true;
		} else {
			pb_backupbuddy::status( 'error', 'Failure copying remote file to local.' );
			return false;
		}
	}
function _process_destination_copy ( $ destination_settings , $ remote_file , $ fileID = '' ) { pb_backupbuddy :: set_greedy_script_limits ( ) ; if ( ! class_exists ( 'backupbuddy_core' ) ) { require_once ( pb_backupbuddy :: plugin_path ( ) . '/classes/core.php' ) ; } require_once ( pb_backupbuddy :: plugin_path ( ) . '/destinations/bootstrap.php' ) ; $ local_file = backupbuddy_core :: getBackupDirectory ( ) . basename ( $ remote_file ) ; if ( file_exists ( basename ( $ local_file ) ) ) { $ local_file = str_replace ( 'backup-' , 'backup_copy_' . pb_backupbuddy :: random_string ( 5 ) . '-' , $ local_file ) ; $ local_file = str_replace ( 'snapshot-' , 'snapshot_copy_' . pb_backupbuddy :: random_string ( 5 ) . '-' , $ local_file ) ; } if ( $ fileID != '' ) { $ remote_file = $ fileID ; } if ( true === pb_backupbuddy_destinations :: getFile ( $ destination_settings , $ remote_file , $ local_file ) ) { pb_backupbuddy :: status ( 'message' , 'Success copying remote file to local.' ) ; return true ; } else { pb_backupbuddy :: status ( 'error' , 'Failure copying remote file to local.' ) ; return false ; } }
_process_destination_copy()
 Downloads a remote backup and copies it to local server.
_process_destination_copy () Downloads a remote backup and copies it to local server .