---
name: "slony_logshipping"
section: "1"
platform: "linux"
package: "slony1-2-bin"
version: "2.2.11-6"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/slony_logshipping"
---

# slony\_logshipping(1)

slony\_logshippping daemon

## NAME

slony\_logshipping - slony\_logshippping daemon

## slony\_logshipper TOOL

slony\_logshipper is a tool designed to help apply logs. It runs as a daemon and scans the archive directory for new .SQL files which it then applies to the  target database. It can be run with three sorts of parameters:

## OPTIONS

- •

  Options, chosen from the following:

  - •

    FC**h**F\[0\]

    display this help text and exit

  - •

    FC**v**F\[0\]

    display program version and exit

  - •

    FC**q**F\[0\]

    quiet mode

  - •

    FC**l**F\[0\]

    cause running daemon to reopen its logfile

  - •

    FC**r**F\[0\]

    cause running daemon to resume after error

  - •

    FC**t**F\[0\]

    cause running daemon to enter smart shutdown mode

  - •

    FC**T**F\[0\]

    cause running daemon to enter immediate shutdown mode

  - •

    FC**c**F\[0\]

    destroy existing semaphore set and message queue (use with caution)

  - •

    FC**f**F\[0\]

    stay in foreground (don't daemonize)

  - •

    FC**w**F\[0\]

    enter smart shutdown mode immediately

- •

  A specified log shipper configuration file

  This configuration file consists of the following specifications:

  - •

    **logfile = './offline\_logs/logshipper.log';**

    Where the log shipper will leave messages.

  - •

    **cluster name = 'T1';**

    Cluster name

  - •

    **destination database = 'dbname=slony\_test3';**

    Optional conninfo for the destination database. If given, the log shipper will connect to this database, and apply logs to it.

  - •

    **archive dir = './offline\_logs';**

    The archive directory is required when running in ‘database-connected’ mode to have a place to scan for missing (unapplied) archives.

  - •

    **destination dir = './offline\_result';**

    If specified, the log shipper will write the results of data massaging into result logfiles in this directory.

  - •

    **max archives = 3600;**

    This fights eventual resource leakage; the daemon will enter ‘smart shutdown’ mode automatically after processing this many archives.

  - •

    **ignore table "public"."history";**

    One may filter out single tables from log shipped replication

  - •

    **ignore namespace "public";**

    One may filter out entire namespaces from log shipped replication

  - •

    **rename namespace "public"."history" to "site\_001"."history";**

    One may rename specific tables.

  - •

    **rename namespace "public" to "site\_001";**

    One may rename entire namespaces.

  - •

    **post processing command = 'gzip -9 $inarchive';**

    Pre- and post-processing commands are executed via FC**[system(3)](/system/3.md)**F\[0\].

  An ‘@’ as the first character causes the exit code to be ignored. Otherwise, a nonzero exit code is treated as an error and causes processing to abort.

  Pre- and post-processing commands have two further special variables defined:

  - •

    **$inarchive** - indicating incoming archive filename

  - •

    **$outnarchive** - indicating outgoing archive filename

- •

  **error command = ' ( echo** **"archive=$inarchive" echo "error messages:" echo "$errortext" ) \| mail** **-s "Slony log shipping failed" postgres@localhost ';**

  The error command indicates a command to execute upon encountering an error. All logging since the last successful completion of an archive is available in the **$errortext** variable.

  In the example shown, this sends an email to the DBAs upon encountering an error.

- •

  Archive File Names

  Each filename is added to the SystemV Message queue for processing by a slony\_logshipper process.
