From a1925e1053f1d7ff522537032f4ab685da5cc872 Mon Sep 17 00:00:00 2001 From: brent s Date: Fri, 1 Sep 2017 19:30:28 -0400 Subject: [PATCH] a little better logging marks --- gpg/sksdump.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gpg/sksdump.py b/gpg/sksdump.py index 45a8736..07dfef4 100755 --- a/gpg/sksdump.py +++ b/gpg/sksdump.py @@ -148,6 +148,8 @@ def syncDB(): '--delete', os.path.join(sks['destdir'], '.'), sks['rsync']] + with open(sks['logfile'], 'a') as f: + f.write('===== {0} Rsyncing to mirror =====\n'.format(str(datetime.datetime.utcnow()))) with open(sks['logfile'], 'a') as f: subprocess.run(cmd, stdout = f, stderr = f) return() @@ -155,9 +157,14 @@ def syncDB(): def main(): if getpass.getuser() not in ('root', sks['user']): exit('ERROR: You must be root or {0}!'.format(sks['user'])) + with open(sks['logfile'], 'a') as f: + f.write('===== {0} STARTING ====='.format(str(datetime.datetime.utcnow()))) dumpDB() compressDB() syncDB() + with open(sks['logfile'], 'a') as f: + f.write('===== {0} DONE ====='.format(str(datetime.datetime.utcnow()))) + if __name__ == '__main__': main()