diff --git a/SurveyDataProcessor.pl b/SurveyDataProcessor.pl index 93efd88978f8eb21c1e7fb76a4a62431890b2d36..5d1a556ee8cd82b750e35a81dba3622b2b9eb2c8 100755 --- a/SurveyDataProcessor.pl +++ b/SurveyDataProcessor.pl @@ -149,6 +149,8 @@ unless($serverFailure) { } +my $localOutputFolderName = $todayFolderPath."/".$jobIDString."_".$todayString."_0000"; + if(!$serverFailure) { #Clustering analysis: @@ -188,8 +190,6 @@ if(!$serverFailure) { my $clusteringOutputFile = $clusteringOutputs[0]; #Uploading data: - my $localOutputFolderName = $todayFolderPath."/".$jobIDString."_".$todayString."_0000"; - mkdir($localOutputFolderName) or handleError("ERROR: Unable to create the output upload staging folder ".$localOutputFolderName); my $sourcesUploadFileName = $localOutputFolderName."/sources_".$todayString.".csv"; @@ -229,7 +229,13 @@ if(!$serverFailure) { if(!($lastSuccessfulClusteringOutputPath eq $clusterFailString)) { unless($debugNoUpload) { #Transfer the output to public server for others to be able to pull it down: - system("scp -i ".$coordinatorPath."/ssh_key_willow"." -r ".$lastSuccessfulClusteringOutputPath." willow.csx.cam.ac.uk:/var/www/html/Ethiopia/"); + print "Transferring old output ".$staleClusteringDataWarningString." from folder ".$lastSuccessfulClusteringOutputPath."\n"; + + dircopy($lastSuccessfulClusteringOutputPath, $localOutputFolderName); + + my $ret = system("scp -i ".$coordinatorPath."/ssh_key_willow"." -r ".$localOutputFolderName." willow.csx.cam.ac.uk:/var/www/html/Ethiopia/"); + + print "Transfer output: ".$ret."\n"; my $warningTimeStamp = getTimestampNow();