datadumper

datadumper - Dump records

datadumper is a dumper command for getting records as a YAML/JSON or CSV from bounceHammer database table (BounceLogs). Some simple sufficient conditions can be specified for searching. This command has been installed in INSTALL-DESTINATION/bin directory.

Usage

datadumper can operate a database like tablectlcommand, databasectl command without using SQL. And WebUI can do this. but It does not have a full function of databasectl command.

Dump all of the records in the DB
# datadumper --alldata
 
Dump the records which the senderdomain is example.com
# datadumper --senderdomain example.com
 
Dump the records which the reason is userunknown and the hostgroup is webmail
# datadumper --reason userunknown --hostgroup webmail
 
Dump the records which the destination is example.org and within a year. # datadumper --destination example.com --howrecent 1y
 
Display help messages
# datadumper --help

Available Options

Options for specifying conditon

-A, --alldata
By default, datadumper with no option displays all the data in a database except records which the value of "disabled" column is 1. When this option is specified, datadumper displays all the data in the database include records which the value of "disabled" column is 1.
-a, --addresser Sender's email address
Specify an addresser (a sender's email addrsss).
-r, --recipient Recipient's email address
Specify a recipient (a Recipient email address).
-s, --senderdomain domain part of Sender
Specify a senderdomain (a domain part of a sender's email address).
-d, --destinaiton domain part of Recipient
Specify a destination (a domain part of a recipient's email address).
-w, --reason reason of email bounce
Specify a reason (of email bounce). To see a list of available values of this option is the result of tablectl -tw --list, See the values of why column.
-g, --hostgroup Host Group Name
Specify a hostgroup (a HostGroup Name). The result of tablectl -th --list will show you the available values of this option, See the values of "name" colummn.
-p, --provider Provider Name
Specify a provider (a Provider Name). The result of tablectl -tp --list will show you the available values of this option, See the value of "name" column.
-t, --token Message Token
Specify a message token string (a Message Token). The message token can be generated by using messagetoken command. This option is equals to the command with both --addresser and --recipient .
-h, --howrecent Number/Unit
Specify the earliest date of the email bounce. The command display records which date (bounced date) is newer than the specified date.

Available value is a positive integer or a positive float number, and available units are s:seconds, m:minutes, h:hours, d:days, w:weeks, and y:years. If the unit is omitted, d(days) is used as a unit.
e.g.) 2w = 2 weeks、3d = 3 days、 1y = 1 year.
-f, --frequency Minimum value of how many email bounce (Beginning with Ver.2.6.3)
The minimum value of frequency (The number of how many email bounce). For Example, If you specify --frequency 6, The command display records which ware bounced for 6 times or more.

Options for Output Format

-o, --orderby Column Name
Sort, ascending order by a specified column (e.g. addresser, recipient, and so on). If this option is omitted, The records are sorted by ID.
-O, --orderbydesc Column Name
Sort, descending order by a specipied column (e.g. addresser, recipient, and so on). If this option is omitted, The records are sorted by ID.
--count
Displays the number of records which are matched with a specified condition (other options of this command). The command with this option will give the same results as the following SQL: SELECT count(*) FROM ... WHERE ... .
--comment
Date and a program name will be displayed at the head of the results. This option may not be useful, and may be removed from the future release of bounceHammer.

Other Options

-C, --conf /path/to/configuration file
Use an alternative bounceHammer's configuration file. If this option is omitted, the command will use INSTALL-DESTINATION/etc/bouncehammer.cf .
-T, --test
Runs as test mode. This option is equals to the option -C INSTALL-DESTINATION/etc/test-run.cf .
-F, --fotmat Character
Display records as a specified format. If this option is omitted, the results are displayed as a ASCII Table. Available format characters are the following: yaml: YAML, asciitable: ASCII Table, and csv: CSV (Beginning with Ver. 2.4.0).
--silent (Beginning with ver.2.1.0)
Turn silent mode on. This option makes the command quiet in spite of -v, --verbose option (described later). And when the command is called from a daemon (such as sendmail), the command will exit with status 0 in spite of an error. If an MTA process (e.g. /usr/sbin/sendmail) which is called the command without this --silent option stopped by an error, the command will exit with status 75(EX_TEMPFAIL).
-v, --verbose
Turn verbose mode ON.
--help
Display help messages of this command.
--version
Display the version number of this command.
--silent

Screenshot of the running command

datadumper --count and other 2 examples

The following screenshot shows that the command with some search conditions display the results as a YAML format.

No TrackBacks

TrackBack URL: http://bouncehammer.jp/cgi-bin/mt/mt-tb.cgi/104

Leave a comment