From 976cd858354b462904aeae1b56bdd12fa16fb022 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 28 May 2008 09:16:51 +0000 Subject: [PATCH] moving refresh-peer.py with MyPLC where it belongs --- build-native.sh | 1 + build.sh | 1 + refresh-peer.py | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 refresh-peer.py diff --git a/build-native.sh b/build-native.sh index 6594cba..5bcc593 100755 --- a/build-native.sh +++ b/build-native.sh @@ -29,6 +29,7 @@ install -D -m 755 plc-config-tty ${tmpdir}/usr/bin/plc-config-tty install -D -m 755 db-config ${tmpdir}/usr/bin/db-config install -D -m 755 dns-config ${tmpdir}/usr/bin/dns-config install -D -m 755 plc-map.py ${tmpdir}/usr/bin/plc-map.py +install -D -m 755 refresh-peer.py ${tmpdir}/usr/bin/refresh-peer.py install -D -m 755 clean-empty-dirs.py ${tmpdir}/usr/bin/clean-empty-dirs.py install -D -m 755 mtail.py ${tmpdir}/usr/bin/mtail.py install -D -m 755 check-ssl-peering.py ${tmpdir}/usr/bin/check-ssl-peering.py diff --git a/build.sh b/build.sh index 4a2c6d2..7fa29c3 100755 --- a/build.sh +++ b/build.sh @@ -64,6 +64,7 @@ install -D -m 755 plc-config-tty root/usr/bin/plc-config-tty install -D -m 755 db-config root/usr/bin/db-config install -D -m 755 dns-config root/usr/bin/dns-config install -D -m 755 plc-map.py root/usr/bin/plc-map.py +install -D -m 755 refresh-peer.py root/usr/bin/refresh-peer.py install -D -m 755 clean-empty-dirs.py root/usr/bin/clean-empty-dirs.py install -D -m 755 mtail.py root/usr/bin/mtail.py install -D -m 755 check-ssl-peering.py root/usr/bin/check-ssl-peering.py diff --git a/refresh-peer.py b/refresh-peer.py new file mode 100644 index 0000000..127544f --- /dev/null +++ b/refresh-peer.py @@ -0,0 +1,39 @@ +#!/usr/bin/env plcsh +# $Id$ + +import sys,os,time + +def Run (peername): + timestring=time.strftime("%Y-%m-%d-%H-%M-%S") + print 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',peername + print 'RefreshPeer on %s - starting on %s'%(peername,timestring) + print 'xxxxxxxxxx' + sys.stdout.flush() + start=time.time() + result=RefreshPeer(peername) + finish=time.time() + + print 'Total duration',finish-start + print 'xxxxxxxxxx timers:' + keys=result.keys() + keys.sort() + for key in keys: + print key,result[key] + sys.stdout.flush() + sys.stderr.flush() + +def RunInLog (peername): + monthstring=time.strftime("%Y-%m") + logname="/var/log/refresh-peer-%s-%s.log"%(peername,monthstring) + sys.stdout=open(logname,'a') + sys.stderr=sys.stdout + Run(peername) + sys.stderr.close() + sys.stdout.close() + +if __name__ == "__main__": + + for peername in sys.argv[1:]: + RunInLog (peername) + + -- 2.43.0