Merge branch 'master' of ssh://git.onelab.eu/git/sfa
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 15 Dec 2011 08:50:54 +0000 (09:50 +0100)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 15 Dec 2011 08:50:54 +0000 (09:50 +0100)
cron.d/sfa.cron
sfa/generic/__init__.py

index c92afb6..00d27b6 100644 (file)
@@ -1,8 +1,14 @@
+#
+# this example file should be installed in /etc/cron.d owned by root
+#
 SHELL=/bin/bash
 PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
+# xxx replace this
 MAILTO=server-msgs@planet-lab.org
 HOME=/
 #
 # minute hour day-of-month month day-of-week user command
-0 * * * *  /usr/bin/sfa-import-plc.py > /dev/null 2>&1
-0 0 * * * /usr/bin/sfa-clean-peer-records.py > /dev/null 2>&1  
+# once or twice an hour makes sense
+0 * * * * root /usr/bin/sfa-import-plc.py         >> /var/log/sfa_import.log 2>&1
+# this is needed only if you run RefreshPeer
+#0 0 * * * root /usr/bin/sfa-clean-peer-records.py >> /var/log/sfa_import.log 2>&1
index 3c3855d..de1a9e1 100644 (file)
@@ -60,6 +60,8 @@ class Generic:
         if not 'interface' in kwargs:
             logger.critical("Generic.make_api: no interface found")
         api = self.api_class()(*args, **kwargs)
+        # xxx can probably drop support for managers implemented as modules 
+        # which makes it a bit awkward
         manager_class_or_module = self.make_manager(api.interface)
         driver = self.make_driver (api.config, api.interface)
         ### arrange stuff together