From ab315394ca2f68b43bc96ea86c403e9c08bf642e Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Mon, 4 Feb 2013 11:01:30 -0500 Subject: [PATCH] Bump to 2013 --- Bucardo.pm | 4 +- Bucardo.pm.html | 2 +- Changes | 2 +- LICENSE | 2 +- README | 2 +- bucardo | 4 +- bucardo.html | 2406 ++++++++++++++++++++++++++++++++++++++++++----- 7 files changed, 2162 insertions(+), 260 deletions(-) diff --git a/Bucardo.pm b/Bucardo.pm index 8204f51cb..ea19dc505 100644 --- a/Bucardo.pm +++ b/Bucardo.pm @@ -5,7 +5,7 @@ ## ## This script should only be called via the 'bucardo' program ## -## Copyright 2006-2012 Greg Sabino Mullane +## Copyright 2006-2013 Greg Sabino Mullane ## ## Please visit http://bucardo.org for more information @@ -9295,7 +9295,7 @@ Greg Sabino Mullane =head1 LICENSE AND COPYRIGHT -Copyright (c) 2005-2012 Greg Sabino Mullane . +Copyright (c) 2005-2013 Greg Sabino Mullane . This software is free to use: see the LICENSE file for details. diff --git a/Bucardo.pm.html b/Bucardo.pm.html index fc8c2dbc9..65685e581 100644 --- a/Bucardo.pm.html +++ b/Bucardo.pm.html @@ -101,7 +101,7 @@ of it in production since 2002. Jon Jensen <

LICENSE AND COPYRIGHT

-

Copyright (c) 2005-2012 Greg Sabino Mullane <greg@endpoint.com>.

+

Copyright (c) 2005-2013 Greg Sabino Mullane <greg@endpoint.com>.

This software is free to use: see the LICENSE file for details.

diff --git a/Changes b/Changes index 4349dce30..c3cdbc349 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,6 @@ [ GSM is Greg Sabino Mullane ] -Bucardo version 5.0.0, released ??, 2012 +Bucardo version 5.0.0, released ??, 2013 - Complete rework of Bucardo: we now allow as many source and target databases as wanted in a single sync. [GSM] diff --git a/LICENSE b/LICENSE index d83681e55..35c1e12b3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Greg Sabino Mullane . All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README b/README index 7078503ea..22272620f 100644 --- a/README +++ b/README @@ -12,7 +12,7 @@ THIS IS NOT A PRODUCTION RELEASE! This is a beta release of version 5. COPYRIGHT: ---------- - Copyright (c) 2005-2012 Greg Sabino Mullane + Copyright (c) 2005-2013 Greg Sabino Mullane This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, diff --git a/bucardo b/bucardo index d42b55f35..362b747f1 100755 --- a/bucardo +++ b/bucardo @@ -3,7 +3,7 @@ ## Script to control Bucardo ## -## Copyright 2006-2012 Greg Sabino Mullane +## Copyright 2006-2013 Greg Sabino Mullane ## ## Please see http://bucardo.org/ for full documentation ## @@ -10819,7 +10819,7 @@ Bucardo =head1 COPYRIGHT -Copyright 2006-2012 Greg Sabino Mullane +Copyright 2006-2013 Greg Sabino Mullane This program is free to use, subject to the limitations in the LICENSE file. diff --git a/bucardo.html b/bucardo.html index 49f0fec5c..22a768408 100644 --- a/bucardo.html +++ b/bucardo.html @@ -18,17 +18,64 @@
  • NAME
  • VERSION
  • -
  • SYNOPSIS
  • +
  • USAGE
  • DESCRIPTION
  • COMMANDS
  • OPTIONS
  • +
  • COMMAND DETAILS
  • +
  • OPTIONS DETAILS
  • FILES
  • ENVIRONMENT VARIABLES
  • BUGS
  • @@ -52,385 +99,2238 @@


    -

    SYNOPSIS

    -
    -  ./bucardo install
    -
    -  ./bucardo list dbs
    -
    -  ./bucardo add sync testsync source=herd1 type=pushdelta targetdb=B
    -
    -  ./bucardo add sync testsync source=herd1 type=pushdelta targetdb=B tables=tab1,tab2,tab3
    -
    -  ./bucardo add database newdb dbname=internal_name port=5432 host=myserver
    -
    -  ./bucardo add all tables db=foo [herd=x] [pkonly]
    -
    -  ./bucardo add all sequences db=foo [herd=x]
    -
    -  ./bucardo add herd newherd table1 table2 table3 ...
    -
    -  ./bucardo add dbgroup name db1 db2 db3 ...
    -
    -  ./bucardo start "Starting up - Greg"
    -
    -  ./bucardo stop "Bringing down for debugging - Raul E."
    -
    -  ./bucardo ping
    +

    USAGE

    -  ./bucardo status
    -
    -  ./bucardo status sync1 sync2
    -
    -  ./bucardo kick sync1 sync2
    -
    -  ./bucardo kick sync1 0
    -
    -  ./bucardo reload_config
    -
    -  ./bucardo upgrade
    -
    -  ./bucardo reload sync
    -
    -  ./bucardo validate sync
    -
    -  ./bucardo message "Your message here"
    -
    -  ./bucardo config show
    -
    -  ./bucardo config set foo=bar baz=123
    + bucardo [<options>] <command> [<action>] [<command-options>] [<command-params>]


    DESCRIPTION

    -

    The bucardo script is the main interaction to a running Bucardo instance. It can -be used to start and stop Bucardo, add new items, kick syncs, and even install and -upgrade Bucardo itself. For more complete documentation, please view the wiki at:

    -

    http://bucardo.org/

    +

    The bucardo script is the main interaction to a running Bucardo instance. It +can be used to start and stop Bucardo, add new items, kick syncs, and even +install and upgrade Bucardo itself. For more complete documentation, please +view the wiki.


    COMMANDS

    +

    Run bucardo help <command> for additional details

    -
    install
    +
    install
    -

    Usage: ./bucardo install

    -

    Attempts to install the Bucardo schema from the file 'bucardo.schema' into an existing -Postgres cluster. The user 'bucardo' and database 'bucardo' will be created first as needed. -This is an interactive installer, but you can supply the following values from the command -line:

    -
    -
    --dbuser (defaults to postgres)
    +

    Installs the Bucardo configuration database.

    +
    +
    upgrade
    -
    --dbname (defaults to postgres)
    +
    +

    Upgrades the Bucardo configuration database to the latest schema.

    +
    +
    start [<start options>] [<reason>]
    -
    --dbport (defaults to 5432)
    +
    +

    Starts Bucardo.

    +
    +
    stop [<reason>]
    -
    --piddir (defaults to /var/run/bucardo/)
    +
    +

    Stops Bucardo.

    +
    +
    restart [<start options>] [<reason>]
    -
    +
    +

    Stops and starts Bucardo.

    -
    upgrade
    +
    list <type> [<regex>]
    -

    Usage: ./bucardo upgrade

    -

    Upgrades an existing Bucardo installation to the current version of the bucardo script. -Requires that the bucardo script and the bucardo.schema file be the same version. All -changes should be backwards compatible, but you may need to re-validate existing scripts -to make sure changes get propagated to all databases.

    +

    Lists objects managed by Bucardo.

    -
    start
    +
    add <type> <name> <parameters>
    -

    Usage: ./bucardo start "Reason --name"

    -

    Restarts Bucardo cleanly by first issuing the equivalent of a stop to ask any existing Bucardo -processes to exit, and then starting a new Bucardo MCP process. A short reason and name should -be provided - these are logged in the reason_file file and sent in the email sent when Bucardo -has been started up.

    -

    Before attempting to kill any old processes, a ping command with a timeout of 5 seconds is issued. -If this returns successfully (indicating an active MCP process already running), the script will -exit with a return value of 2.

    +

    Adds a new object.

    -
    stop
    +
    update <type> <name> <parameters>
    -

    Usage: ./bucardo stop "Reason --name"

    -

    Forces Bucardo to quit by creating a stop file which all MCP, CTL, and KID processes should -detect and cause them to exit. Note that active syncs will not exit right away, as they -will not look for the stop file until they have finished their current run. Typically, -you should scan the list of processes after running this program to make sure that all Bucardo -processes have stopped. One should also provide a reason for issuing the stop - usually -this is a short explanation and your name. This is logged in the reason_file file and -is also used by Bucardo when it exits and sends out mail about its death.

    +

    Updates an object.

    -
    list
    +
    remove <type> <name> [<name>...]
    -

    Usage: ./bucardo list <type> <regex>

    -

    Lists summary information about dbs, dbgroups, tables, sequences, -syncs, herds, customnames, customcols or customcode. Adding anything -after the type will look up all matching entries.

    +

    Removes one or more objects.

    -
    add
    +
    kick <syncname> [<sync options>] [<syncname>...] [<timeout>]
    -

    Usage: add <item_type> <item_name>

    -

    Usage: add db <dbname> dbname=internal_name port=xxx host=xxx user=xxx pass=xxx service=xxx conn=xxx ssp=1/0

    -

    Usage: add dbgroup name db1 db2 db3 ...

    -

    Usage: add table [schema].table db=internal_db_name ping=bool standard_conflict=xxx herd=xxx

    -

    Usage: add all tables [herd=xxx] [pkonly]

    -

    Usage: add sequence [schema].table herd=xxx

    -

    Usage: add all sequences herd=xxx

    -

    Usage: add sync syncname options

    -

    Usage: add herd name

    -

    Usage: add customname tablename newtablename [sync=x db=x]

    -

    Usage: add customcols tablename select_clause [sync=x db=x]

    -

    Usage: add customcode <name> <whenrun=value> <src_code=filename> [optional information]

    -

    Tells Bucardo about new objects it should know about. These commands can -replace direct manipulation of the tables in the bucardo schema for the -supported object types (you'll still need to add things like the mappings between objects on your own).

    +

    Kicks off one or more syncs.

    -
    remove
    +
    reload config
    -

    Usage: remove <item_type> <item_name>

    -

    Removes one or more items from the Bucardo database. Valid item types are database, -dbgroup, herd, sync, table, and sequence.

    +

    Sends a message to all CTL and KID processes asking them to reload the Bucardo +configuration.

    -
    kick
    +
    show all|<setting> [<setting>...]
    -

    Usage: ./bucardo kick <syncname(s)> [timeout]

    -

    Tells one or more named syncs to fire as soon as possible. Note that this simply sends a request that -the sync fire: it may not start right away if the same sync is already running, or if the source or -target database has exceeded the number of allowed Bucardo connections. If the final argument is a -number, it is treated as a timeout. If this number is zero, the bucardo command will not return -until the sync has finished. For any other number, the sync will wait at most that number of seconds. -If any sync has not finished before the timeout, a false value is returned. In all other cases, a -true value is returned.

    -

    If a timeout is given, the total completion time in seconds is also displayed. If the sync is going to -multiple targets, the time that each target takes from the start of the kick is also shown as each -target finishes.

    +

    Shows the current Bucardo settings.

    -
    reload_config
    +
    <set <setting=value [<setting=value>...] >>
    -

    Forces Bucardo to reload the bucardo_config file, and then restart all processes to ensure that the new -information is loaded.

    +

    Sets one or more configuration setting..

    -
    show
    +
    ping [<timeout>]
    -

    Usage: ./bucardo show <all|setting1> [setting2..]

    -

    Shows the current settings in the bucardo_config table. Use the keyword 'all' to see all the settings, or -specify one or more search terms.

    +

    Sends a ping notice to the MCP process to see if it will respond.

    -
    set
    +
    status [<status options>] <syncname> [<syncname>...]
    -

    Usage: ./bucardo set setting1=value [setting2=value]

    -

    Sets one or more items inside the bucardo_config table. Setting names are case-insensitive.

    +

    Shows the brief status of syncs in a tabular format.

    -
    ping
    +
    activate <syncname> [<syncname>...] [<timeout>]
    -

    Sends a ping notice to the MCP process to see if it will respond. By default, it will wait 15 seconds. A -numeric argument will change this timeout. Using a 0 as the timeout indicates waiting forever. If a response -was returned, the program will exit with a value of 0. If it times out, the value will be 1.

    +

    Activates one or more named syncs.

    -
    status
    +
    deactivate <syncname> [<syncname>...] [<timeout>]
    -

    Usage: ./bucardo status [syncname(s)] [--sort=#] [--showdays] [--compress]

    -

    Shows the brief status of all known syncs in a tabular format. If given one or more syncnames, -shows detailed information for each one. To see detailed information for all syncs, simply -use 'status all'.

    -

    When showing brief information, the columns are:

    -
      -
    1. Name +

      Deactivates one or more named syncs.

      +
    +
    message <body>
    -

    The name of the sync

    - -
  • State +
    +

    Sends a message to the running Bucardo logs.

    +
    +
    reload [<syncname> [<syncname>...]]
    -

    The state of the sync. Can be 'Good', 'Bad', 'Empty', or 'No records found'

    -
  • -
  • Last good +
    +

    Sends a message to one or more sync processes, instructing them to reload.

    +
    +
    inspect <type> <name> [<name>...]
    -

    When the sync last successfully ran.

    -
  • -
  • Time +
    +

    Inspects one or more objects of a particular type.

    +
    +
    validate all|<syncname> [<syncname>...]
    -

    How long it has been since the last sync success

    -
  • -
  • Last I/U +
    +

    Validates one or more syncs.

    +
    +
    purge all|<table> [<table>...]
    -

    The number of insert and deletes performed by the last successful sync. May also show -the number of rows truncated (T) or conflicted (C), if applicable.

    -
  • -
  • Last bad +
    +

    Purges the delta and track tables for one or more tables, for one or more +databases.

    +
    +
    help [<command> [<action>]]
    -

    When the sync last failed.

    -
  • -
  • Time +
    +

    Shows help.

    +
    + +

    +

    +
    +

    OPTIONS

    +
    +  -d --db-name       NAME  Database name.
    +  -U --db-user       USER  Database user name.
    +  -P --db-pass       PASS  Database password.
    +  -h --db-host       HOST  Database server host name.
    +  -p --db-port       PORT  Database server port number.
    +     --bucardorc     FILE  Use specified .bucarorc file.
    +     --no-bucardorc        Do not use .bucardorc file.
    +     --quiet               Incremental quiet.
    +     --verbose             Incremental verbose mode.
    +  -? --help                Output basic help and exit.
    +     --version             Print the version number and exit.
    +

    +

    +
    +

    COMMAND DETAILS

    +

    Most of the commands take parameters. These may be passed after the command +name and, where appropriate, an object name. Parameters take the form of +key/value pairs separated by an equal sign (=). For example:

    +
    +  bucardo add db sea_widgets dbname=widgets host=db.example.com
    +

    Here dbname and <host> are parameters.

    +

    Many of the commands also use command-line options, which are specified in the +normal way. For example, the bucardo add db command could also be written +as:

    +
    +  bucardo add db sea_widgets --dbname widgets --dbhost db.example.com
    +

    However, parameters and options are not directly interchangeable in all cases. +See the documentation for individual commands for their supported options.

    +

    +

    +

    install

    +
    +  bucardo install
    +

    Installs the Bucardo schema from the file bucardo.schema into an existing Postgres cluster. +The user "bucardo" and database "bucardo" will be created first as needed. This is an +interactive installer, but you can supply the following values from the command line:

    +
    +
    --dbuser
    -

    How long it has been since the last sync failure

    -
  • - +
    +

    defaults to postgres

    -
    activate syncname [syncname2 syncname3 ...] [timeout]
    +
    --dbname
    -

    Activates one or more named syncs. If given a timeout argument, it will wait until it has received -confirmation from Bucardo that each sync has been successfully activated.

    +

    defaults to postgres

    -
    deactivate syncname [syncname2 syncname3 ...] [timeout]
    +
    --dbport
    -

    Deactivates one or more named syncs. If given a timeout argument, it will wait until it has received -confirmation from Bucardo that the sync has been successfully deactivated.

    +

    defaults to 5432

    -
    message
    +
    --pid-dir
    -

    Adds a message to the running Bucardo logs. This message will appear prefixed with "MESSAGE: ". If -Bucardo is not running, the message will go to the logs the next time Bucardo is running and someone -adds another message.

    +

    defaults to /var/run/bucardo/

    -
    -

    OPTIONS

    -

    It is usually easier to set most of these options at the top of the script, or make an alias for them, -as they will not change very often if at all.

    +

    upgrade

    +
    +  bucardo upgrade
    +

    Upgrades an existing Bucardo installation to the current version of the bucardo database +script. Requires that bucardo and the bucardo.schema file be the same version. All +changes should be backwards compatible, but you may need to re-validate existing scripts +to make sure changes get propagated to all databases.

    +

    +

    +

    start

    +
    +  bucardo start "Reason"
    +

    Starts Bucardo. Fails if the MCP process is running (determined if its PID file is present). +Otherwise, starts cleanly by first issuing the equivalent of a stop to ask any existing Bucardo +processes to exit, and then starting a new Bucardo MCP process. A short reason and name should +be provided - these are written to the reason_file file (./bucardo.restart.reason.txt by +default) and sent in the email sent when Bucardo has been started up. It is also appended to +the reason log, which has the same name as the the reason_file but ends in .log.

    +

    The options for the start command are:

    +
    +
    --sendmail
    + +
    +

    Tells Bucardo whether or not to send mail on interesting events: startup, +shutdown, and errors. Default is on.

    +
    +
    --extra-name string
    + +
    +

    A short string that will be appended to the version string as output by the +Bucardo process names. Mostly useful for debugging.

    +
    +
    --log-destination destination
    + +
    +

    Determines the destination for logging output. The supported values are:

    -
    --dbport=number
    +
    stderr
    + +
    stdout
    -
    --dbhost=string
    +
    syslog
    -
    --dbname=string
    +
    none
    -
    --dbuser=string
    +
    A file system directory.
    + +
    +

    May be specified more than once, which is useful for, e.g., logging both to a +directory and to syslog. If --log-destination is not specified at all, the +default is to log to files in /var/log/bucardo.

    +
    +
    --log-separate
    -
    --dbpass=string
    +
    +

    Forces creation of separate log files for each Bucardo process of the form +"log.bucardo.X.Y", where X is the type of process (MCP, CTL, or KID), and Y is +the process ID.

    +
    +
    --log-extension string
    -

    The port, host, and name of the Bucardo database, the user to connect as, and the password to use.

    +

    Appends the given string to the end of the default log file name, +log.bucardo. A dot is added before the name as well, so a log extension of +"rootdb" would produce a log file named log.bucardo.rootdb.

    -
    --verbose
    +
    --log-clean
    -

    Makes bucardo run verbosely. Default is off.

    +

    Forces removal of all old log files before running.

    -
    --quiet
    +
    --debug
    + +
    --no-debug
    -

    Tells bucardo to be as quiet as possible. Default is off.

    +

    Enable or disable debugging output. Disabled by default.

    -
    --help
    +
    --exit-on-nosync
    + +
    --no-exit-on-nosync
    -

    Shows a brief summary of usage for bucardo.

    +

    On startup, if Bucardo finds no active syncs, it normally will continue to +run, requiring a restart once syncs are added. This is useful for startup +scripts and whatnot.

    +

    If, however, you want it to exit when there are no active syncs, pass the +--exit-on-nosync option. You can also be explicit that it should not +exit when there are no syncs by passing --no-exit-on-nosync. This is the +default value.

    -

    Kick arguments

    -

    The following arguments are only used with the 'kick' command:

    +

    stop

    +
    +  bucardo stop "Reason"
    +

    Forces Bucardo to quit by creating a stop file which all MCP, CTL, and KID processes should +detect and cause them to exit. Note that active syncs will not exit right away, as they +will not look for the stop file until they have finished their current run. Typically, +you should scan the list of processes after running this program to make sure that all Bucardo +processes have stopped. One should also provide a reason for issuing the stop - usually +this is a short explanation and your name. This is written to the reason_file file +(./bucardo.restart.reason.txt by default) and is also used by Bucardo when it exits and +sends out mail about its death. It is also appended to the reason log, which has the same name +as the the reason_file but ends in .log.

    +

    +

    +

    restart

    +
    +  bucardo restart "Reason"
    +

    Stops bucardo, waits for the stop to complete, and then starts it again. +Supports the same options as <start/start>. Useful for start scripts. For +getting just CTL and KID processes to recognize newly added, updated, or +removed objects, use the reload command, instead.

    +

    +

    +

    list

    +
    +  bucardo list <type> <regex>
    +

    Lists summary information about Bucardo objects. The supported types are:

    + +

    The all option will list information about all object types.

    +

    The optional regex option can be used to filter the list to only those +matching a regular expression.

    +

    Aliases:

    +
    +
    l
    + +
    lsit
    + +
    liast
    + +
    lisy
    + +
    lit
    + +
    +

    +

    +

    add

    +
    +  bucardo add <type> <name> <parameters>
    +

    Adds a new object to Bucardo. The type specifies the type of object to add, +while the name should be the name of the object. The supported types +include:

    +
    +
    db
    + +
    dbgroup
    + +
    table
    + +
    sequence
    + +
    all tables
    + +
    all sequences
    + +
    relgroup
    + +
    sync
    + +
    customname
    + +
    customcols
    + +
    customcols
    + +
    +

    +

    +

    add db

    +
    +  bucardo add db <name> dbname=actual_name port=xxx host=xxx user=xxx pass=xxx
    +

    Adds a new database. The name is the name by which the database will be +known to Bucardo, and must be unique. This may vary from the actual database +name, as multiple hosts might have databases with the same name.

    +

    The supported named parameters are:

    -
    --retry=#
    +
    dbname
    + +
    db
    -

    The number of times to retry a sync if it fails. Defaults to 0.

    +

    The actual name of the database. Required.

    -
    --retrysleep
    +
    type
    + +
    dbtype
    -

    How long to sleep, in seconds, between each retry attempt.

    +

    The type of the database. Defaults to postgres. Currently supported values are:

    +
    -
    --notimer
    +
    username
    + +
    dbuser
    + +
    user
    -

    By default, kicks with a timeout argument give a running real-time summary of time elapsed by -using the backspace character. This may not be wanted if running a kick, for example, -via a cronjob, so turning --notimer on will simply print the entire message without backspaces.

    +

    The username Bucardo should use to connect to the database. Optional.

    -
    -

    -

    -

    Status arguments

    -

    The following arguments are only used with the 'status' command:

    -
    -
    --showdays
    +
    password
    + +
    dbpass
    + +
    pass
    -

    Specifies whether or not do list the time interval with days, or simply show the hours. For example, -"3d 12h 6m 3s" vs. "48h 6m 3s"

    +

    The password Bucardo should use when connecting to the database. Optional.

    -
    --compress
    +
    dbhost
    + +
    pghost
    + +
    host
    -

    Specifies whether or not to compress the time interval by removing spaces. Mostly used to limit -the width of the 'status' display.

    +

    The host name to which to connect. Defaults to the value of the $PGHOSTADDR +or $PGHOST environment variables, if present. Optional.

    -
    --sort=#
    +
    dbport
    + +
    pgport
    + +
    port
    -

    Requests sorting of the 'status' output by one of the nine columns. Use a negative number to reverse -the sort order.

    +

    The port to which to connect. Defaults to the value of the $PGPORT +environment variable, if present. Optional.

    -
    -

    -

    -

    Startup arguments

    -

    The following arguments are only applicable when using the "start" command:

    -
    -
    --sendmail
    +
    dbconn
    + +
    pgconn
    + +
    conn
    -

    Tells Bucardo whether or not to send mail on interesting events: startup, shutdown, and errors. Default is on. -Only applicable when using ./bucardo start.

    +

    Additional connection parameters, e.g., sslmode=require. Optional.

    -
    --extraname=string
    +
    status
    -

    A short string that will be appended to the version string as output by the Bucardo process names. Mostly -useful for debugging.

    +

    Initial status of the database in Bucardo. Must be either "active" or +"inactive". Defaults to "active".

    -
    --debugfilesep
    +
    dbgroup
    + +
    group
    -

    Forces creation of separate log files for each Bucardo process of the form "log.bucardo.X.Y", -where X is the type of process (MCP, CTL, or KID), and Y is the process ID.

    +

    Bucardo database group to which to add the database. Optional.

    -
    --debugsyslog
    +
    addalltables
    -

    Sends all log messages to the syslog daemon. On by default. The facility used is controlled by -the row "syslog_facility" in the bucardo_config table, and defaults to "LOG_LOCAL1".

    +

    Automatically adds all tables once the database has been added. Optional.

    -
    --debugfile
    +
    addallsequences
    -

    If set, writes detailed debugging information to one or more files.

    +

    Automatically adds all sequences once the database has been added. Optional.

    -
    --debugdir=directory name
    +
    server_side_prepares
    + +
    ssp
    -

    Directory where the debug files should go.

    +

    Enable or disable server-side prepares. Pass 1 to enable them or 0 to disable +them. Defaults to 1.

    -
    --debugname=string
    +
    dbservice
    + +
    service
    -

    Appends the given string to the end of the default debug file name, "log.bucardo". A dot is added -before the name as well, so a debugname of "rootdb" would produce a log file named "log.bucardo.rootdb".

    +

    The service name to use for a Postgres database. Optional.

    -
    --cleandebugs
    +
    +

    +

    +

    add dbgroup

    +
    +  bucardo add dbgroup name db1:source db2:source db3:target ...
    +

    Adds one or more databases to the named database group. If the database group +doesn't exist, it will be created. The database parameters should specify +their roles, either "source" or "target".

    +

    +

    +

    add table

    +
    +  bucardo add table [schema].table db=actual_db_name
    +

    Adds a table object. The table information will be read from the specified +database. Supported parameters:

    +
    +
    db
    -

    Forces removal of all old debug files before running.

    +

    The name of the database from which to read the table information. Should be a +name known to Bucardo, thanks to a previous call to add database. Required.

    +
    +
    autokick
    + +
    +

    Boolean indicating whether or not the table should automatically send kick +messages when it's modified. Overrides the autokick parameter of any syncs +of which the table is a part.

    +
    +
    rebuild_index
    + +
    +

    Boolean indicating whether or not to rebuild indexes after every sync. Off by +default. Optional.

    +
    +
    analyze_after_copy
    + +
    +

    Boolean indicating whether or not to analyze the table after every sync. Off +by default. Optional.

    +
    +
    vaccuum_after_copy
    + +
    +

    Boolean indicating whether or not to vacuum the table after every sync. Off by +default. Optional.

    +
    +
    relgroup
    + +
    +

    Adds the table to the named relation group. If the relation group does not +exist, it will be created. Optional.

    +
    +
    makedelta
    + +
    +

    Turns makedelta magic on or off. Value is a list of databases which need makedelta +for this table. Value can also be "on" to enable makedelta for all databases. +Defaults to "off".

    +
    +
    +

    +

    +

    add sequence

    +
    +  bucardo add sequence [schema].sequence relgroup=xxx
    +
    +
    db
    + +
    +

    The name of the database from which to read the sequence information. Should +be a name known to Bucardo, thanks to a previous call to add database. +Required.

    +
    +
    relgroup
    + +
    +

    Adds the sequence to the named relation group. If the relation group does not +exist, it will be created. Optional.

    +
    +
    +

    +

    +

    add all tables

    +
    +  bucardo add all tables [relgroup=xxx] [pkonly]
    +

    Adds all the tables in all known databases or in a specified database. +Excludes tables in the pg_catalog, information_schema, and bucardo +schemas. (Yes, this means that you cannot replicate the Bucardo configuration +database using Bucardo. Sorry about that.) Supported options and parameters:

    +
    +
    db
    + +
    --db
    + +
    +

    Name of the database from which to find all the tables to add. If not +provided, tables will be added from all known databases.

    +
    +
    schema
    + +
    --schema
    + +
    -n
    + +
    +

    Limit to the tables in the specified comma-delimited list of schemas. The +options may be specified more than once.

    +
    +
    exclude-schema
    + +
    --exclude-schema
    + +
    -N
    + +
    +

    Exclude tables in the specified comma-delimited list of schemas. The options +may be specified more than once.

    +
    +
    table
    + +
    --table
    + +
    -t
    + +
    +

    Limit to the specified tables. The options may be specified more than once.

    +
    +
    exclude-table
    + +
    --exclude-table
    + +
    -T
    + +
    +

    Exclude the specified tables. The options may be specified more than once.

    +
    +
    relgroup
    + +
    --relgroup
    + +
    +

    Name of the relation group to which to add new tables.

    +
    +
    pkonly
    + +
    +

    Exclude tables without primary keys.

    +
    +
    +

    +

    +

    add all sequences

    +
    +  bucardo add all sequences relgroup=xxx
    +

    Adds all the sequences in all known databases or in a specified database. +Excludes sequences in the pg_catalog, information_schema, and bucardo +schemas. (Yes, this means that you cannot replicate the Bucardo configuration +database using Bucardo. Sorry about that.) Supported options and parameters:

    +
    +
    db
    + +
    --db
    + +
    +

    Name of the database from which to find all the sequences to add. If not +provided, sequences will be added from all known databases.

    +
    +
    schema
    + +
    --schema
    + +
    -n
    + +
    +

    Limit to the sequences in the specified comma-delimited list of schemas. The +options may be specified more than once.

    +
    +
    exclude-schema
    + +
    --exclude-schema
    + +
    -N
    + +
    +

    Exclude sequences in the specified comma-delimited list of schemas. The +options may be specified more than once.

    +
    +
    relgroup
    + +
    --relgroup
    + +
    +

    Name of the relation group to which to add new tables or sequences.

    +
    +
    +

    +

    +

    add relgroup

    +
    +  bucardo add relgroup name
    +  bucardo add relgroup name table, sequence, ...
    +

    Adds a relation group. After the name, pass in an optional list of tables +and/or sequences and they will be added to the group.

    +

    +

    +

    add sync

    +
    +  bucardo add sync syncname relgroup=xxx dbs=xxx
    +

    Adds a sync, which is a named replication event containing information about +what to replicate from where to where. The supported parameters are:

    +
    +
    dbs
    + +
    +

    The name of a database group or comma-delimited list of databases. All of the +specified databases will be synchronized. Required.

    +
    +
    relgroup
    + +
    +

    The name of a relation group to synchronize. All of the tables and/or +sequences in the relgroup will be synchronized. Required unless tables is +specified.

    +
    +
    tables
    + +
    +

    List of tables to add to the sync. This implicitly creates a relation group +with the same name as the sync. Required unless relgroup is specified.

    +
    +
    status
    + +
    +

    Indicates whether or not the sync is active. Must be either "active" or +"inactive". Defaults to "active".

    +
    +
    rebuild_index
    + +
    +

    Boolean indicating whether or not to rebuild indexes after every sync. +Defaults to off.

    +
    +
    lifetime
    + +
    +

    Number of seconds a KID can live before being reaped. No limit by default.

    +
    +
    maxkicks
    + +
    +

    Number of times a KID may be kicked before being reaped. No limit by default.

    +
    +
    conflict_strategy
    + +
    +

    The conflict resolution strategy to use in the sync. Supported values:

    +
    +
    bucardo_source
    + +
    +

    The rows on the "source" database always "win". In other words, in a conflict, +Bucardo copies rows from source to target.

    +
    +
    bucardo_target
    + +
    +

    The rows on the "target" database always win.

    +
    +
    bucardo_skip
    + +
    +

    Any conflicting rows are simply not replicated. Not recommended for most +cases.

    +
    +
    bucardo_random
    + +
    +

    Each database has an equal chance of winning each time. This is the default.

    +
    +
    bucardo_latest
    + +
    +

    The row that was most recently changed wins.

    +
    +
    bucardo_abort
    + +
    +

    The sync is aborted on a conflict.

    +
    +
    +
    +
    onetimecopy
    + +
    +

    Determines whether or not a sync should switch to a full copy mode for a +single run. Supported values are:

    +
      +
    1. : off + +
    2. +
    3. : always full copy + +
    4. +
    5. : only copy tables that are empty on the target + +
    6. +
    +
    +
    stayalive
    + +
    +

    Boolean indicating whether or not the sync processes (CTL) should be +persistent. Defaults to false.

    +
    +
    kidsalive
    + +
    +

    Boolean indicating whether or not the sync child processes (KID) should be +persistent. Defaults to false.

    +
    +
    autokick
    + +
    +

    Boolean indicating whether or not tables in the sync should automatically send +kick messages when they're modified. May be overridden by the autokick +parameter of individual tables.

    +
    +
    checktime
    + +
    +

    An interval specifying the maximum time a sync should go before being +kicked. Useful for busy systems where you don't want the overhead of notify +triggers.

    +
    +
    priority
    + +
    +

    An integer indicating the priority of the sync. Lower numbers are higher +priority. Currently used only for display purposes.

    +
    +
    analyze_after_copy
    + +
    +

    Boolean indicating whether or not to analyze tables after every sync. Off by +default. Optional.

    +
    +
    overdue
    + +
    +

    An interval specifying the amount of time after which the sync has not run +that it should be considered overdue. check_bucardo_sync issues a warning +when a sync has not been run in this amount of time.

    +
    +
    expired
    + +
    +

    An interval specifying the amount of time after which the sync has not run +that it should be considered expired. check_bucardo_sync issues a critical +message when a sync has not been run in this amount of time.

    +
    +
    track_rates
    + +
    +

    Boolean indicating whether or not to track synchronization rates.

    +
    +
    rebuild_index
    + +
    +

    Boolean indicating whether or not to rebuild indexes after every sync. Off by +default. Optional.

    +
    +
    +

    +

    +

    add customname

    +
    +  bucardo add customname oldname newname [db=name] [sync=name]
    +

    Creates a new Bucardo custom name mapping. This allows the tables involved in +replication to have different names on different databases. The oldname +must contain the schema as well as the table name (if the source database +supports schemas). The optional parameters limit it to one or more databases, +and/or to one or more syncs. Supported parameters:

    +
    +
    sync
    + +
    +

    A sync to which to add the customname. May be specified multiple times.

    +
    +
    database
    + +
    db
    + +
    +

    A database for which to add the customname. May be specified multiple times.

    +
    +
    +

    +

    +

    add customcols

    +
    +  bucardo add customcols tablename select_clause [sync=x db=x]
    +

    Specify the list of columns to select from when syncing. Rather than the +default SELECT * behavior, you can specify any columns you want, including +the use of function call return values and things not in the source column +list. The optional parameters limit it to one or more databases, and/or to one +or more syncs. Some examples:

    +
    +  bucardo add customcols public.foobar "select a, b, c"
    +  bucardo add customcols public.foobar "select a, upper(b) AS b, c" db=foo
    +  bucardo add customcols public.foobar "select a, b, c" db=foo sync=abc
    +

    Supported parameters:

    +
    +
    sync
    + +
    +

    A sync to which to add the customcols. May be specified multiple times.

    +
    +
    database
    + +
    db
    + +
    +

    A database for which to add the customcols. May be specified multiple times.

    +
    +
    +

    +

    +

    add customcode

    +
    +  bucardo add customcode <name> <whenrun=value> <src_code=filename> [optional information]
    +

    Adds a customcode, which is a Perl subroutine that can be run at certain +points in the sync process. It might handle exceptions, handle conflicts, or +just run at certain times with no expectation of functionality (e.g., before +Bucardo drops triggers). Metadata about that point will be passed to the +subroutine as a hash reference.

    +

    Supported parameters:

    +
    +
    name
    + +
    +

    The name of the custom code object.

    +
    +
    about
    + +
    +

    A short description of the custom code.

    +
    +
    whenrun
    + +
    when_run
    + +
    +

    A string indicating when the custom code should be run. Supported values +include:

    +
    +
    before_txn
    + +
    before_check_rows
    + +
    before_trigger_drop
    + +
    after_trigger_drop
    + +
    after_table_sync
    + +
    exception
    + +
    conflict
    + +
    before_trigger_enable
    + +
    after_trigger_enable
    + +
    after_txn
    + +
    before_sync
    + +
    after_sync
    + +
    +
    +
    getdbh
    + +
    +

    Boolean indicating whether or not Perl DBI database handles should be +provided to the custom code subroutine. If true, database handles will be +provided under the dbh key of the hash reference passed to the subroutine. +The value under this key will be a hash reference mapping database names to +their respective handles.

    +
    +
    sync
    + +
    +

    Name of the sync with which to associate the custom code.

    +
    +
    relation
    + +
    +

    Name of the table or sequence with which to associate the custom code.

    +
    +
    status
    + +
    +

    The current status of this customcode. Anything other than "active" means the +code is not run.

    +
    +
    priority
    + +
    +

    Number indicating the priority in which order to execute custom codes. Lower numbers +are higher priority. Useful for subroutines that set lastcode in order to +cancel the execution of subsequent custom codes for the same when_run.

    +
    +
    src_code
    + +
    +

    File from which to read the custom code Perl source.

    +
    +
    +

    The body of the Perl subroutine should be implemented in the src_code file, +and not inside a sub declaration. When called, it will be passed a single +hash reference with the following keys:

    +
    +
    syncname
    + +
    +

    The name of the currently-executing sync.

    +
    +
    version
    + +
    +

    The version of Bucardo executing the sync.

    +
    +
    sourcename
    + +
    +

    The name of the source database.

    +
    +
    targetname
    + +
    +

    The name of the target database.

    +
    +
    sendmail
    + +
    +

    A code reference that can be used to send email messages.

    +
    +
    sourcedbh
    + +
    +

    A DBI database handle to the sync source database. Provided only to custom +code executed by the controller.

    +
    +
    rellist
    + +
    +

    An array reference of hash references, each representing a relation in the +sync. Provided only to custom code executed by the controller. The keys in +the hash are the same as the parameters supported by add table and +add sequence, as appropriate.

    +
    +
    schemaname
    + +
    +

    The schema for the table that triggered the exception. Provided only to +"exception" custom codes.

    +
    +
    tablename
    + +
    +

    The name of the table that triggered the exception. Provided only to +"exception" custom codes.

    +
    +
    error_string
    + +
    +

    The string containing the actual error message. Provided only to "exception" +custom codes.

    +
    +
    deltabin
    + +
    +

    A hash reference with the name of each source database as a key and a list of +all primary keys joined together with "\0". Provided only to "exception" +custom codes.

    +
    +
    attempts
    + +
    +

    The number of times the sync has been attempted. Provided only to "exception" +custom codes.

    +
    +
    conflicts
    + +
    +

    A hash reference of conflicting rows. The keys are the primary key values, and +the values are hash references with the names of the databases containing the +conflicting rows and true values. Provided only to "conflict" custom codes.

    +
    +
    +

    The custom code subroutine may set any of these keys in the hash reference to +change the behavior of the sync:

    +
    +
    message
    + +
    +

    Message to send to the logs.

    +
    +
    warning
    + +
    +

    A warning to emit after the subroutine has returned.

    +
    +
    error
    + +
    +

    An error to be thrown after the subroutine has returned.

    +
    +
    nextcode
    + +
    +

    Set to send execution to the next custom code of the same type. Mainly useful +to exception custom codes, and supported only by custom codes executed by the +controller.

    +
    +
    lastcode
    + +
    +

    Set to true to have any subsequent custom codes of the same type to be +skipped.

    +
    +
    endsync
    + +
    +

    Cancels the sync altogether.

    +
    +
    +

    An example:

    +
    +  use strict;
    +  use warnings;
    +  use Data::Dumper;
    +
    +  my $info = shift;
    +
    +  # Let's open a file.
    +  my $file = '/tmp/bucardo_dump.txt';
    +  open my $fh, '>:encoding(UTF-8)', $file or do {
    +      $info->{warning} = "Cannot open $file: $!\n";
    +      return;
    +  };
    +
    +  # Inspect $info for fun.
    +  print $fh Dumper $info;
    +  close $fh or $info->{warning} = "Error closing $file: $!\n";
    +
    +  # Log a message and return.
    +  $info->{message} = 'IN UR DATABASEZ NORMALIZIN UR RELAYSHUNS';
    +  return;
    +

    +

    +

    update

    +
    +  bucardo update <type> <name> <parameters>
    +

    Updates a Bucardo object. The type specifies the type of object to update, +while the name should be the name of the object. The supported parameters +for each type are the same as those for add. The supported types are:

    +
    +
    customcode
    + +
    db
    + +
    sync
    + +
    table
    + +
    sequence
    + +
    +

    +

    +

    update customcode

    +
    +  bucardo update customcode <name> setting=value
    +

    Updates an existing customcode. Items that can be changed are:

    +
    +
    about
    + +
    +

    A short description of the custom code.

    +
    +
    getdbh
    + +
    +

    Boolean indicating whether or not Perl DBI database handles should be +provided to the custom code subroutine. If true, database handles will be +provided under the dbh key of the hash reference passed to the subroutine. +The value under this key will be a hash reference mapping database names to +their respective handles.

    +
    +
    name
    + +
    +

    The name of the custom code object.

    +
    +
    priority
    + +
    +

    Number indicating the priority in which order to execute custom codes. Lower numbers +are higher priority. Useful for subroutines that set lastcode in order to +cancel the execution of subsequent custom codes for the same when_run.

    +
    +
    +
    +
    status
    + +
    +

    The current status of this customcode. Anything other than "active" means the +code is not run.

    +
    +
    whenrun
    + +
    +

    A string indicating when the custom code should be run. Supported values include:

    +
    +
    before_txn
    + +
    before_check_rows
    + +
    before_trigger_drop
    + +
    after_trigger_drop
    + +
    after_table_sync
    + +
    exception
    + +
    conflict
    + +
    before_trigger_enable
    + +
    after_trigger_enable
    + +
    after_txn
    + +
    before_sync
    + +
    after_sync
    + +
    +
    +
    +

    +

    +

    update db

    +
    +  bucardo udpate db <name> port=xxx host=xxx user=xxx pass=xxx
    +

    Updates a database. The name is the name by which the database is known to +Bucardo. This may vary from the actual database name, as multiple hosts might +have databases with the same name.

    +

    The supported named parameters are:

    +
    +
    dbname
    + +
    db
    + +
    +

    The actual name of the database.

    +
    +
    type
    + +
    dbtype
    + +
    +

    The type of the database. Currently supported values are:

    +
      +
    • postgres + +
    • +
    • drizzle + +
    • +
    • mongo + +
    • +
    • mysql + +
    • +
    • maria + +
    • +
    • oracle + +
    • +
    • redis + +
    • +
    • sqlite + +
    • +
    +
    +
    username
    + +
    dbuser
    + +
    user
    + +
    +

    The username Bucardo should use to connect to the database.

    +
    +
    password
    + +
    dbpass
    + +
    pass
    + +
    +

    The password Bucardo should use when connecting to the database.

    +
    +
    dbhost
    + +
    pghost
    + +
    host
    + +
    +

    The host name to which to connect.

    +
    +
    dbport
    + +
    pgport
    + +
    port
    + +
    +

    The port to which to connect.

    +
    +
    dbconn
    + +
    pgconn
    + +
    conn
    + +
    +

    Additional connection parameters, e.g., sslmode=require. Optional.

    +
    +
    status
    + +
    +

    Status of the database in Bucardo. Must be either "active" or "inactive".

    +
    +
    dbgroup
    + +
    server_side_prepares
    + +
    ssp
    + +
    +

    Enable or disable server-side prepares. Pass 1 to enable them or 0 to disable +them.

    +
    +
    dbservice
    + +
    service
    + +
    +

    The service name to use for a Postgres database.

    +
    +
    group
    + +
    +

    A comma-separated list of database groups to which to add the database. The +database will be removed from any other groups of which it was previously a +member.

    +
    +
    +

    +

    +

    update sync

    +
    +  bucardo update sync syncname relgroup=xxx dbs=xxx
    +

    Updates a sync, which is a named replication event containing information about +what to replicate from where to where. The supported parameters are:

    +
    +
    name
    + +
    +

    The name of the sync.

    +
    +
    dbs
    + +
    +

    The name of a database group or comma-delimited list of databases.

    +
    +
    relgroup
    + +
    +

    The name of a relation group to synchronize.

    +
    +
    status
    + +
    +

    Indicates whether or not the sync is active. Must be either "active" or +"inactive".

    +
    +
    rebuild_index
    + +
    +

    Boolean indicating whether or not to rebuild indexes after every sync.

    +
    +
    lifetime
    + +
    +

    Number of seconds a KID can live before being reaped.

    +
    +
    maxkicks
    + +
    +

    Number of times a KID may be kicked before being reaped.

    +
    +
    conflict_strategy
    + +
    +

    The conflict resolution strategy to use in the sync. Supported values:

    +
    +
    bucardo_source
    + +
    +

    The rows on the "source" database always "win". In other words, in a conflict, +Bucardo copies rows from source to target.

    +
    +
    bucardo_target
    + +
    +

    The rows on the "target" database always win.

    +
    +
    bucardo_skip
    + +
    +

    Any conflicting rows are simply not replicated. Not recommended for most +cases.

    +
    +
    bucardo_random
    + +
    +

    Each database has an equal chance of winning each time.

    +
    +
    bucardo_latest
    + +
    +

    The row that was most recently changed wins.

    +
    +
    bucardo_abort
    + +
    +

    The sync is aborted on a conflict.

    +
    +
    +
    +
    onetimecopy
    + +
    +

    Determines whether or not a sync should switch to a full copy mode for a +single run. Supported values are:

    +
      +
    1. : off + +
    2. +
    3. : always full copy + +
    4. +
    5. : only copy tables that are empty on the target + +
    6. +
    +
    +
    stayalive
    + +
    +

    Boolean indicating whether or not the sync processes (CTL) should be +persistent.

    +
    +
    kidsalive
    + +
    +

    Boolean indicating whether or not the sync child processes (KID) should be +persistent.

    +
    +
    autokick
    + +
    +

    Boolean indicating whether or not tables in the sync should automatically send +kick messages when they're modified. May be overridden by the autokick +parameter of individual tables.

    +
    +
    checktime
    + +
    +

    An interval specifying the maximum time a sync should go before being +kicked. Useful for busy systems where you don't want the overhead of notify +triggers.

    +
    +
    priority
    + +
    +

    An integer indicating the priority of the sync. Lower numbers are higher +priority. Currently used only for display purposes.

    +
    +
    analyze_after_copy
    + +
    +

    Boolean indicating whether or not to analyze tables after every sync. Off by +default.

    +
    +
    overdue
    + +
    +

    An interval specifying the amount of time after which the sync has not run +that it should be considered overdue. check_bucardo_sync issues a warning +when a sync has not been run in this amount of time.

    +
    +
    expired
    + +
    +

    An interval specifying the amount of time after which the sync has not run +that it should be considered expired. check_bucardo_sync issues a critical +message when a sync has not been run in this amount of time.

    +
    +
    track_rates
    + +
    +

    Boolean indicating whether or not to track synchronization rates.

    +
    +
    rebuild_index
    + +
    +

    Boolean indicating whether or not to rebuild indexes after every sync.

    +
    +
    +

    +

    +

    update table

    +
    +  bucardo update table [schema].table db=actual_db_name
    +

    Updates a table object. The table information will be read from the specified +database. Supported parameters:

    +
    +
    db
    + +
    +

    The name of the database from which to read the table information. Should be a +name known to Bucardo.

    +
    +
    schemaname
    + +
    +

    The name of the schema in which the table is found.

    +
    +
    tablename
    + +
    +

    The actual name of the table.

    +
    +
    autokick
    + +
    +

    Boolean indicating whether or not the table should automatically send kick +messages when it's modified. Overrides the autokick parameter of any syncs +of which the table is a part.

    +
    +
    rebuild_index
    + +
    +

    Boolean indicating whether or not to rebuild indexes after every sync.

    +
    +
    analyze_after_copy
    + +
    +

    Boolean indicating whether or not to analyze the table after every sync.

    +
    +
    vaccuum_after_copy
    + +
    +

    Boolean indicating whether or not to vacuum the table after every sync.

    +
    +
    relgroup
    + +
    +

    Adds the table to the named relation group. May be specified more than once. +The table will be removed from any other relation groups.

    +
    +
    makedelta
    + +
    +

    Specifies which databases need makedelta enabled for this table.

    +
    +
    +

    +

    +

    update sequence

    +
    +  bucardo update sequence [schema].sequence relgroup=xxx
    +
    +
    db
    + +
    +

    The name of the database where the sequence lives.

    +
    +
    schemaname
    + +
    +

    The name of the schema in which the sequence is found.

    +
    +
    relgroup
    + +
    +

    Adds the sequence to the named relation group. May be specified more than +once. The sequence will be removed from any other relation groups.

    +
    +
    +

    +

    +

    remove

    +
    +  bucardo remove <item_type> <item_name>
    +

    Removes one or more objects from Bucardo. Valid item types are;

    +
      +
    • db or database + +

      Use the --force option to clear out related tables and groups instead of +erroring out.

      +
    • +
    • dbgroup + +
    • +
    • relgroup + +
    • +
    • sync + +
    • +
    • table + +
    • +
    • sequence + +
    • +
    • customcols + +
    • +
    • customname + +
    • +
    • customcode + +
    • +
    +

    Aliases:

    +
    +
    delete
    + +
    del
    + +
    +

    +

    +

    kick

    +
    +  bucardo kick <syncname(s)> [timeout]
    +

    Tells one or more named syncs to fire as soon as possible. Note that this simply sends a request that +the sync fire: it may not start right away if the same sync is already running, or if the source or +target database has exceeded the number of allowed Bucardo connections. If the final argument is a +number, it is treated as a timeout. If this number is zero, the bucardo command will not return +until the sync has finished. For any other number, the sync will wait at most that number of seconds. +If any sync has not finished before the timeout, an exit value of 1 will be returned. Errors will +cause exit values of 2 or 3. In all other cases, an exit value of 0 will be returned.

    +

    If a timeout is given, the total completion time in seconds is also displayed. If the sync is going to +multiple targets, the time that each target takes from the start of the kick is also shown as each +target finishes. Options:

    +
    +
    --retry
    + +
    +

    The number of times to retry a sync if it fails. Defaults to 0.

    +
    +
    --retry-sleep
    + +
    +

    How long to sleep, in seconds, between each retry attempt.

    +
    +
    --notimer
    + +
    +

    By default, kicks with a timeout argument give a running real-time summary of +time elapsed by using the backspace character. This may not be wanted if +running a kick, for example, via a cronjob, so turning --notimer on will +simply print the entire message without backspaces.

    +
    +
    +

    +

    +

    reload config

    +
    +  bucardo reload config
    +  bucardo reload config 30
    +

    Sends a message to all CTL and KID processes asking them to reload the Bucardo +configuration. This configuration is a series of key/value pairs that +configure Bucardo's behavior, and not any of the objects managed by the +add, remove, or update commands.

    +

    By default, Bucardo will send the message and then exit. Pass an optional +number and Bucardo will instead wait up to that length of time for all child +processes to report completion.

    +

    +

    +

    set

    +
    +  bucardo set setting1=value [setting2=value]
    +

    Sets one or more configuration setting table. Setting names are +case-insensitive. The available settings are:

    +
    +
    autosync_ddl
    + +
    +

    Which DDL changing conditions do we try to remedy automatically? Default: newcol.

    +
    +
    bucardo_current_version
    + +
    +

    Current version of Bucardo. Default: 4.99.6.

    +
    +
    bucardo_vac
    + +
    +

    Do we want the automatic VAC daemon to run? Default: 1.

    +
    +
    bucardo_version
    + +
    +

    Bucardo version this schema was created with. Default: 4.99.6.

    +
    +
    ctl_checkonkids_time
    + +
    +

    How often does the controller check on the kids health? Default: 10.

    +
    +
    ctl_createkid_time
    + +
    +

    How long do we sleep to allow kids-on-demand to get on their feet? Default: 0.5.

    +
    +
    ctl_sleep
    + +
    +

    How long does the controller loop sleep? Default: 0.2.

    +
    +
    default_conflict_strategy
    + +
    +

    Default conflict strategy for all syncs. Default: bucardo_latest.

    +
    +
    default_email_from
    + +
    +

    Who the alert emails are sent as. Default: nobody@example.com.

    +
    +
    default_email_host
    + +
    +

    Which host to send email through. Default: localhost.

    +
    +
    default_email_to
    + +
    +

    Who to send alert emails to. Default: nobody@example.com.

    +
    +
    email_debug_file
    + +
    +

    File to save a copy of all outgoing emails to. Default: None.

    +
    +
    endsync_sleep
    + +
    +

    How long do we sleep when custom code requests an endsync? Default: 1.0.

    +
    +
    flatfile_dir
    + +
    +

    Directory to store the flatfile output inside of. Default: ..

    +
    +
    host_safety_check
    + +
    +

    Regex to make sure we don't accidentally run where we should not. Default: None.

    +
    +
    kid_deadlock_sleep
    + +
    +

    How long to sleep in seconds if we hit a deadlock error. Default: 0.5. +Set to -1 to prevent the kid from retrying.

    +
    +
    kid_nodeltarows_sleep
    + +
    +

    How long do kids sleep if no delta rows are found? Default: 0.5.

    +
    +
    kid_pingtime
    + +
    +

    How often do we ping check the KID? Default: 60.

    +
    +
    kid_restart_sleep
    + +
    +

    How long to sleep in seconds when restarting a kid? Default: 1.

    +
    +
    kid_serial_sleep
    + +
    +

    How long to sleep in seconds if we hit a serialization error. Default: 0.5. +Set to -1 to prevent the kid from retrying.

    +
    +
    kid_sleep
    + +
    +

    How long does a kid loop sleep? Default: 0.5.

    +
    +
    log_conflict_file
    + +
    +

    Name of the conflict detail log file. Default: bucardo_conflict.log.

    +
    +
    log_level
    + +
    +

    How verbose to make the logging. Higher is more verbose. Default: normal.

    +
    +
    log_microsecond
    + +
    +

    Show microsecond output in the timestamps? Default: 0.

    +
    +
    log_showlevel
    + +
    +

    Show log level in the log output? Default: 0.

    +
    +
    log_showline
    + +
    +

    Show line number in the log output? Default: 0.

    +
    +
    log_showpid
    + +
    +

    Show PID in the log output? Default: 1.

    +
    +
    log_showtime
    + +
    +

    Show timestamp in the log output? 0=off 1=seconds since epoch 2=scalar gmtime 3=scalar localtime. Default: 3.

    +
    +
    mcp_dbproblem_sleep
    + +
    +

    How many seconds to sleep before trying to respawn. Default: 15.

    +
    +
    mcp_loop_sleep
    + +
    +

    How long does the main MCP daemon sleep between loops? Default: 0.2.

    +
    +
    mcp_pingtime
    + +
    +

    How often do we ping check the MCP? Default: 60.

    +
    +
    mcp_vactime
    + +
    +

    How often in seconds do we check that a VAC is still running? Default: 60.

    +
    +
    piddir
    + +
    +

    Directory holding Bucardo PID files. Default: /var/run/bucardo.

    +
    +
    reason_file
    + +
    +

    File to hold reasons for stopping and starting. Default: bucardo.restart.reason.txt.

    +
    +
    semaphore_table
    + +
    +

    Table to let apps know a sync is ongoing. Default: bucardo_status.

    +
    +
    statement_chunk_size
    + +
    +

    How many primary keys to shove into a single statement. Default: 10000.

    +
    +
    stats_script_url
    + +
    +

    Location of the stats script. Default: http://www.bucardo.org/.

    +
    +
    stopfile
    + +
    +

    Name of the semaphore file used to stop Bucardo processes. Default: fullstopbucardo.

    +
    +
    syslog_facility
    + +
    +

    Which syslog facility level to use. Default: log_local1.

    +
    +
    tcp_keepalives_count
    + +
    +

    How many probes to send. 0 indicates sticking with system defaults. Default: 0.

    +
    +
    tcp_keepalives_idle
    + +
    +

    How long to wait between each keepalive probe. Default: 0.

    +
    +
    tcp_keepalives_interval
    + +
    +

    How long to wait for a response to a keepalive probe. Default: 0.

    +
    +
    vac_run
    + +
    +

    How often does the VAC process run? Default: 30.

    +
    +
    vac_sleep
    + +
    +

    How long does VAC process sleep between runs? Default: 120.

    +
    +
    warning_file
    + +
    +

    File containing all log lines starting with "Warning". Default: bucardo.warning.log.

    +
    +
    +

    +

    +

    show

    +
    +  bucardo show all|<setting> [<setting>...]
    +

    Shows the current Bucardo settings. Use the keyword "all" to see all the +settings, or specify one or more search terms. See set for complete +details on the configuration settings.

    +

    +

    +

    config

    +
    +  bucardo config show all|<setting> [<setting>...]
    +  bucardo config set <setting=value> [<setting=value>...]
    +

    Deprecated interface for showing and setting configuration settings. Use the +show and set commands, instead.

    +

    +

    +

    ping

    +
    +  bucardo ping
    +  bucardo ping 60
    +  bucardo ping 0
    +

    Sends a ping notice to the MCP process to see if it will respond. By default, it will wait 15 seconds. A +numeric argument will change this timeout. Using a 0 as the timeout indicates waiting forever. If a response +was returned, the program will exit with a value of 0. If it times out, the value will be 1. +Returns a Nagios like message starting with "OK" or "CRITICAL" for success or failure.

    +

    +

    +

    status

    +
    +  bucardo status [syncname(s)] [--sort=#] [--show-days] [--compress]
    +

    Shows the brief status of all known syncs in a tabular format. If given one or more sync names, +shows detailed information for each one. To see detailed information for all syncs, simply +use "status all"

    +

    When showing brief information, the columns are:

    +
      +
    1. Name + +

      The name of the sync

      +
    2. +
    3. State + +

      The state of the sync. Can be 'Good', 'Bad', 'Empty', or 'No records found'

      +
    4. +
    5. Last good + +

      When the sync last successfully ran.

      +
    6. +
    7. Time + +

      How long it has been since the last sync success

      +
    8. +
    9. Last I/U + +

      The number of insert and deletes performed by the last successful sync. May also show +the number of rows truncated (T) or conflicted (C), if applicable.

      +
    10. +
    11. Last bad + +

      When the sync last failed.

      +
    12. +
    13. Time + +

      How long it has been since the last sync failure

      +
    14. +
    +

    The options for status are:

    +
    +
    --show-days
    + +
    +

    Specifies whether or not do list the time interval with days, or simply show +the hours. For example, "3d 12h 6m 3s" vs. "48h 6m 3s"

    +
    +
    --compress
    + +
    +

    Specifies whether or not to compress the time interval by removing spaces. +Mostly used to limit the width of the 'status' display.

    +
    +
    --sort=#
    + +
    +

    Requests sorting of the 'status' output by one of the nine columns. Use a +negative number to reverse the sort order.

    +
    +
    +

    +

    +

    activate

    +
    +  bucardo activate syncname [syncname2 syncname3 ...] [timeout]
    +

    Activates one or more named syncs. If given a timeout argument, it will wait until it has received +confirmation from Bucardo that each sync has been successfully activated.

    +

    +

    +

    deactivate

    +
    +  bucardo deactivate syncname [syncname2 syncname3 ...] [timeout]
    +

    Deactivates one or more named syncs. If given a timeout argument, it will wait until it has received +confirmation from Bucardo that the sync has been successfully deactivated.

    +

    +

    +

    message

    +
    +  bucardo message 'I WAS HERE'
    +

    Sends a message to the running Bucardo logs. This message will appear prefixed with "MESSAGE: ". If +Bucardo is not running, the message will go to the logs the next time Bucardo runs and someone +adds another message.

    +

    +

    +

    reload

    +
    +  bucardo reload [syncname2 syncname3 ...]
    +

    Sends a message to one or more sync processes, instructing them to reload. +Waits for each to reload before going on to the next. Reloading consists of +deactivating a sync, reloading its information from the database, and +activating it again.

    +

    +

    +

    inspect

    +
    +  bucardo inspect <type> <name> [<name2>...]
    +

    Inspects one or more objects of a particular type. The results are sent to +STDOUT. The supported types include:

    +
    +
    table
    + +
    sync
    + +
    relgroup
    + +
    +

    +

    +

    validate

    +
    +  bucardo validate all|<sync> [<sync>...]
    +

    Validates one or more syncs. Use the keyword "all" to validate all syncs, or +specify one or more syncs to validate.

    +

    +

    +

    purge

    +
    +  bucardo purge all|<table> [<table>...]
    +

    Purges the delta and track tables for one or more tables, for one or more +databases. Use the keyword "all" to validate all tables, or specify one or +more tables to validate.

    +

    +

    +

    help

    +
    +  bucardo help
    +  bucardo help <command>
    +  bucardo help <command> <action>
    +

    Get help. General help can be returned, as well as help for a single command +or a command and its action. Some examples:

    +
    +  bucard help list
    +  bucard help add table
    +

    +

    +
    +

    OPTIONS DETAILS

    +

    It is usually easier to set most of these options at the top of the script, or make an alias for them, +as they will not change very often if at all.

    +
    +
    -d
    + +
    --db-name
    + +
    +
    +  bucardo --db-name widgets
    +  bucardo -d bricolage
    +

    Name of the Bucardo database to which to connect.

    +
    +
    -U
    + +
    --db-user
    + +
    +
    +  bucardo --db-user postgres
    +  bucardo -U Mom
    +

    User name to use when connecting to the Bucardo database.

    +
    +
    -P
    + +
    --db-pass
    + +
    +
    +  bucardo --db-pass s3cr1t
    +  bucardo -P lolz
    +

    Password to use when connecting to the Bucardo database.

    +
    +
    -h
    + +
    --db-host
    + +
    +
    +  bucardo --db-host db.example.com
    +  bucardo -h db2.example.net
    +

    Host name to use when connecting to the Bucardo database.

    +
    +
    -p
    + +
    --db-port
    + +
    +
    +  bucardo --db-port 7654
    +

    Port number to connect to when connecting to the Bucardo database.

    +
    +
    --bucardorc
    + +
    +
    +  bucardo --bucardorc myrcfile
    +

    Use the specified file for configuration instead of the default +./.bucardorc.

    +
    +
    --no-bucardorc
    + +
    +

    Do not use the ./.bucardorc configuration file.

    +
    +
    --verbose
    + +
    +

    Makes bucardo run verbosely. Default is off.

    +
    +
    --quiet
    + +
    +

    Tells bucardo to be as quiet as possible. Default is off.

    +
    +
    --help
    + +
    +

    Shows a brief summary of usage for bucardo.

    @@ -441,7 +2341,7 @@ before the name as well, so a debugname of "rootdb" would produce a lo the current directory will be used if found. If not found, then the file ~/.bucardorc will be used. Finally, the file /etc/bucardorc will be used if available. The format of the file is option = value, one per line. Any line starting with a '#' will be skipped. Any values loaded from a bucardorc file will be overwritten by -command-line options. All bucardorc files can be ignored by supplying a --no-bucardorc argument. A specific +command-line options. All bucardorc files can be ignored by supplying a --no-bucardorc argument. A specific file can be forced with the --bucardorc=file option; if this option is set, bucardo will refuse to run unless that file can be read.

    @@ -453,7 +2353,9 @@ unless that file can be read.


    BUGS

    -

    Bug reports and feature requests are always welcome, please visit http://bucardo.org or email bucardo-general@bucardo.org.

    +

    Bug reports and feature requests are always welcome, please visit +bucardo.org, file GitHub Issues, or post to our +email list.


    @@ -463,7 +2365,7 @@ unless that file can be read.


    COPYRIGHT

    -

    Copyright 2006-2012 Greg Sabino Mullane <greg@endpoint.com>

    +

    Copyright 2006-2013 Greg Sabino Mullane <greg@endpoint.com>

    This program is free to use, subject to the limitations in the LICENSE file.

    -- 2.39.5