'\" -*- coding: us-ascii -*- .if \n(.g .ds T< \\FC .if \n(.g .ds T> \\F[\n[.fam]] .de URL \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac .TH slony_logshipping 1 "26 September 2016" "" "Slony-I 2.2.5 Documentation" .SH NAME slony_logshipping \- slony_logshippping daemon .SH "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: .SH OPTIONS .TP 0.2i \(bu Options, chosen from the following: .RS .TP 0.2i \(bu \*(T<\fBh\fR\*(T> display this help text and exit .TP 0.2i \(bu \*(T<\fBv\fR\*(T> display program version and exit .TP 0.2i \(bu \*(T<\fBq\fR\*(T> quiet mode .TP 0.2i \(bu \*(T<\fBl\fR\*(T> cause running daemon to reopen its logfile .TP 0.2i \(bu \*(T<\fBr\fR\*(T> cause running daemon to resume after error .TP 0.2i \(bu \*(T<\fBt\fR\*(T> cause running daemon to enter smart shutdown mode .TP 0.2i \(bu \*(T<\fBT\fR\*(T> cause running daemon to enter immediate shutdown mode .TP 0.2i \(bu \*(T<\fBc\fR\*(T> destroy existing semaphore set and message queue (use with caution) .TP 0.2i \(bu \*(T<\fBf\fR\*(T> stay in foreground (don't daemonize) .TP 0.2i \(bu \*(T<\fBw\fR\*(T> enter smart shutdown mode immediately .RE .TP 0.2i \(bu A specified log shipper configuration file This configuration file consists of the following specifications: .RS .TP 0.2i \(bu \fBlogfile = './offline_logs/logshipper.log';\fR Where the log shipper will leave messages. .TP 0.2i \(bu \fBcluster name = 'T1';\fR Cluster name .TP 0.2i \(bu \fBdestination database = 'dbname=slony_test3';\fR Optional conninfo for the destination database. If given, the log shipper will connect to this database, and apply logs to it. .TP 0.2i \(bu \fBarchive dir = './offline_logs';\fR The archive directory is required when running in \(oqdatabase-connected\(cq mode to have a place to scan for missing (unapplied) archives. .TP 0.2i \(bu \fBdestination dir = './offline_result';\fR If specified, the log shipper will write the results of data massaging into result logfiles in this directory. .TP 0.2i \(bu \fBmax archives = 3600;\fR This fights eventual resource leakage; the daemon will enter \(oqsmart shutdown\(cq mode automatically after processing this many archives. .TP 0.2i \(bu \fBignore table "public"."history";\fR One may filter out single tables from log shipped replication .TP 0.2i \(bu \fBignore namespace "public";\fR One may filter out entire namespaces from log shipped replication .TP 0.2i \(bu \fBrename namespace "public"."history" to "site_001"."history";\fR One may rename specific tables. .TP 0.2i \(bu \fBrename namespace "public" to "site_001";\fR One may rename entire namespaces. .TP 0.2i \(bu \fBpost processing command = 'gzip -9 $inarchive';\fR Pre- and post-processing commands are executed via \*(T<\fBsystem(3)\fR\*(T>. .RE An \(oq@\(cq 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: .RS .TP 0.2i \(bu \fB$inarchive\fR - indicating incoming archive filename .TP 0.2i \(bu \fB$outnarchive\fR - indicating outgoing archive filename .RE .TP 0.2i \(bu \fBerror command = ' ( echo "archive=$inarchive" echo "error messages:" echo "$errortext" ) | mail -s "Slony log shipping failed" postgres@localhost ';\fR 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 \fB$errortext\fR variable. In the example shown, this sends an email to the DBAs upon encountering an error. .TP 0.2i \(bu Archive File Names Each filename is added to the SystemV Message queue for processing by a slony_logshipper process.