X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=bin%2Fmailshears;h=d34ce54f719749df9ceb78e5625123589b5ad2e4;hp=fc20dd3b4b7302ce536e90210d87cad474ad1e34;hb=6327411ce5538751bd5b3ae07f13da4267d6aa11;hpb=da71911046617ccffbb899b57162c5e6bdbb37ee diff --git a/bin/mailshears b/bin/mailshears index fc20dd3..d34ce54 100755 --- a/bin/mailshears +++ b/bin/mailshears @@ -63,9 +63,26 @@ end # Figure out which addresses are in the filesystem, but not in the # database. -difference = [fs_accts - db_accts] +difference = fs_accts - db_accts # Don't output any unnecessary junk. Cron might mail it to someone. if difference.size > 0 + + # The header that we output before the list of accounts. + # Just the path of this script, and the current time. + header = "#{$0}, " + + current_time = Time.now() + if current_time.respond_to?(:iso8601) + # Somehow this method is missing on some machines. + header += current_time.iso8601.to_s + else + # Fall back to whatever this looks like. + header += current_time.to_s + end + + puts header + puts '-' * header.size # Underline the header. puts difference + puts "" end