diff --git a/maven-meeper/src/bin/synchronize/syncopate/sync b/maven-meeper/src/bin/synchronize/syncopate/sync index 002d9dc0b..af682fbe6 100755 --- a/maven-meeper/src/bin/synchronize/syncopate/sync +++ b/maven-meeper/src/bin/synchronize/syncopate/sync @@ -168,6 +168,8 @@ sub runRsync() open( SYNC, "$cmd 2>&1 |" ); my $rawReportText; + + my $sendMail = 0; while( ) { @@ -187,6 +189,8 @@ sub runRsync() print REPORT "" . $details[3] . " " . $details[4] . "" . "\n"; print REPORT "" . "\n"; + + $sendMail = 1; } else { @@ -195,6 +199,14 @@ sub runRsync() print RAW_REPORT; } } + + close SYNC; + my $exitCode = $?; + + if ( $exitCode != 0 ) + { + $sendMail = 1; + } print REPORT "" . "\n"; @@ -210,8 +222,7 @@ sub runRsync() close( RAW_REPORT ); - if ( $rawReportText ) - + if ( $rawReportText and $sendMail != 0 ) { $rawReportText = $rawReportText . "\n\nYou can view the syncronization reports for today here: \n\n";