summaryrefslogtreecommitdiff
path: root/scripts/queue_mover.py
diff options
context:
space:
mode:
authorAsko Oja2009-05-04 14:02:39 +0000
committerMarko Kreen2009-06-01 07:49:44 +0000
commit9cbd16ab343c28c55012127a1cb643b793547416 (patch)
tree6a5b351db839396c8d6912d2a0eb90fe1c94d734 /scripts/queue_mover.py
parent16e20c4daccb4f0e95249d8fcfe32e89bae41882 (diff)
python scripts: Move template config to docstring.
* Template config is now in docstring to make to more easy to keep up-to-date. * dbscript: --ini option to show template config.
Diffstat (limited to 'scripts/queue_mover.py')
-rwxr-xr-xscripts/queue_mover.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/scripts/queue_mover.py b/scripts/queue_mover.py
index bcfed8f0..6c0556d6 100755
--- a/scripts/queue_mover.py
+++ b/scripts/queue_mover.py
@@ -1,14 +1,31 @@
#! /usr/bin/env python
-"""This script simply mover events from one queue to another."""
+"""This script simply mover events from one queue to another.
+
+Config template::
+
+ [queue_mover]
+ job_name = qm_sourcedb_to_targetdb
+
+ src_db = dbname=sourcedb
+ dst_db = dbname=targetdb
+
+ pgq_queue_name = source_queue
+ dst_queue_name = dest_queue
+
+ logfile = ~/log/%(job_name)s.log
+ pidfile = ~/pid/%(job_name)s.pid
+
+ use_skylog = 0
+"""
import sys, os, pgq
class QueueMover(pgq.SerialConsumer):
- """Plain queue copy."""
+ __doc__ = __doc__
+
def __init__(self, args):
pgq.SerialConsumer.__init__(self, "queue_mover", "src_db", "dst_db", args)
-
self.dst_queue_name = self.cf.get("dst_queue_name")
def process_remote_batch(self, db, batch_id, ev_list, dst_db):