diff options
author | Rob Austein <sra@hactrn.net> | 2013-04-05 22:36:23 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2013-04-05 22:36:23 +0000 |
commit | b9ea94e261276a1da6ab9d4242d39b6f99894218 (patch) | |
tree | 2ea452d13d3017635f2ea8a406f6320df8791a60 /rpkid/rpki-sql-backup.py | |
parent | 52b5cb0ad90b445c44c4797c688b46012c3240bc (diff) |
Consolidate list of scripts for setup.py to install into setup.py, get
rid of a lot of Makefile.in code that no longer serves any useful
purpose.
svn path=/trunk/; revision=5285
Diffstat (limited to 'rpkid/rpki-sql-backup.py')
-rw-r--r-- | rpkid/rpki-sql-backup.py | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/rpkid/rpki-sql-backup.py b/rpkid/rpki-sql-backup.py deleted file mode 100644 index 561aa4e5..00000000 --- a/rpkid/rpki-sql-backup.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python - -""" -Back up data from SQL databases, looking at config file to figure out -which databases and what credentials to use with them. - -For the moment, this just writes all the SQL to stdout. - -$Id$ - -Copyright (C) 2010-2012 Internet Systems Consortium ("ISC") - -Permission to use, copy, modify, and distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -""" - -import subprocess, os, getopt, sys, time, rpki.config - -os.environ["TZ"] = "UTC" -time.tzset() - -cfg_file = None - -opts, argv = getopt.getopt(sys.argv[1:], "c:h?", ["config=", "help"]) -for o, a in opts: - if o in ("-h", "--help", "-?"): - print __doc__ - sys.exit(0) - elif o in ("-c", "--config"): - cfg_file = a - -cfg = rpki.config.parser(cfg_file, "myrpki") - -def dump(section): - subprocess.check_call( - ("mysqldump", "--add-drop-database", - "-u", cfg.get("sql-username", section = section), - "-p" + cfg.get("sql-password", section = section), - "-B", cfg.get("sql-database", section = section))) - -if cfg.getboolean("start_rpkid", False): - dump("irdbd") - -if cfg.getboolean("start_irdbd", False): - dump("rpkid") - -if cfg.getboolean("start_pubd", False): - dump("pubd") |