diff options
author | Asko Oja | 2009-05-04 14:02:39 +0000 |
---|---|---|
committer | Marko Kreen | 2009-06-01 07:49:44 +0000 |
commit | 9cbd16ab343c28c55012127a1cb643b793547416 (patch) | |
tree | 6a5b351db839396c8d6912d2a0eb90fe1c94d734 /scripts/queue_mover.py | |
parent | 16e20c4daccb4f0e95249d8fcfe32e89bae41882 (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-x | scripts/queue_mover.py | 23 |
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): |