예제 #1
0
 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);
     }
     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;
     }
 }