]> git.parisson.com Git - yomguy-tools.git/commitdiff
add tempo to restartd logger
authoryomguy <yomguy@457c0346-1240-4656-8a5a-9edca8063506>
Tue, 14 Dec 2010 08:15:51 +0000 (08:15 +0000)
committeryomguy <yomguy@457c0346-1240-4656-8a5a-9edca8063506>
Tue, 14 Dec 2010 08:15:51 +0000 (08:15 +0000)
git-svn-id: http://svn.parisson.org/svn/tools/trunk@140 457c0346-1240-4656-8a5a-9edca8063506

various/mail_logger.py

index 04c728539a5922c7b42235fcb0f00504ccaf5e42..84688bff5983b1b8009ba9a55cd0dac5ee1136f2 100755 (executable)
@@ -56,9 +56,13 @@ def main():
     service = sys.argv[-2]
     server = sys.argv[-3]
     emails = ['yomguy@sfr.fr','yomguy@parisson.com', 'janob@parisson.com']
-    p = ParissonMailLogger(emails, server, service, txt_file)
-    p.send()
-    p.smtp_server.quit()
+
+    date = os.path.getmtime(txt_file)
+    laps = time.time() - date
+    if laps > 120:
+        p = ParissonMailLogger(emails, server, service, txt_file)
+        p.send()
+        p.smtp_server.quit()
 
 if __name__ == '__main__':
     main()