diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-05-31 09:16:09 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-05-31 09:16:09 +0200 |
commit | ba0146b8789d33afee9c3644ad7dade5b99ae1ba (patch) | |
tree | 7766002188b89de288dbe0b082347dfe98a1b767 | |
parent | 94e167995537015f5100b526791cd51268aa0f2f (diff) |
add -g option to taler-exchange-dbinit
-rw-r--r-- | doc/taler-exchange-dbinit.1 | 5 | ||||
-rw-r--r-- | src/exchange-tools/taler-exchange-dbinit.c | 14 |
2 files changed, 18 insertions, 1 deletions
diff --git a/doc/taler-exchange-dbinit.1 b/doc/taler-exchange-dbinit.1 index 92bf83b09..a1559959f 100644 --- a/doc/taler-exchange-dbinit.1 +++ b/doc/taler-exchange-dbinit.1 @@ -1,4 +1,4 @@ -.TH TALER\-EXCHANGE\-DBINIT 1 "Apr 22, 2015" "GNU Taler" +.TH TALER\-EXCHANGE\-DBINIT 1 "May 31, 2016" "GNU Taler" .SH NAME taler\-exchange\-dbinit \- Initialize Taler exchange database. @@ -19,6 +19,9 @@ Use the configuration and other resources for the exchange to operate from DIRNA .IP "\-h, \-\-help" Print short help on options. .B +.IP "\-g, \-\-gc" +Garbage collect database. Deletes all unnecessary data in the database. +.B .IP "\-r, \-\-reset" Drop tables. Dangerous, will delete all existing data in the database before creating the tables. .B diff --git a/src/exchange-tools/taler-exchange-dbinit.c b/src/exchange-tools/taler-exchange-dbinit.c index 16d76e4d0..cf768f4ca 100644 --- a/src/exchange-tools/taler-exchange-dbinit.c +++ b/src/exchange-tools/taler-exchange-dbinit.c @@ -34,6 +34,11 @@ static int global_ret; static int reset_db; /** + * -g option: garbage collect DB reset + */ +static int gc_db; + +/** * Main function that will be run. * * @param cls closure @@ -68,6 +73,12 @@ run (void *cls, global_ret = 1; return; } + if (gc_db) + { + if (GNUNET_SYSERR == plugin->gc (plugin->cls)) + fprintf (stderr, + "Garbage collection failed!\n"); + } TALER_EXCHANGEDB_plugin_unload (plugin); } @@ -88,6 +99,9 @@ main (int argc, {'r', "reset", NULL, "reset database (DANGEROUS: all existing data is lost!)", 0, &GNUNET_GETOPT_set_one, &reset_db}, + {'g', "gc", NULL, + "garbage collect database", 0, + &GNUNET_GETOPT_set_one, &gc_db}, GNUNET_GETOPT_OPTION_END }; |