.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "PGCOPYDB SNAPSHOT" "1" "Mar 15, 2023" "0.11" "pgcopydb" .SH NAME pgcopydb snapshot \- pgcopydb snapshot .sp pgcopydb snapshot \- Create and exports a snapshot on the source database .sp The command \fBpgcopydb snapshot\fP connects to the source database and executes a SQL query to export a snapshot. The obtained snapshot is both printed on stdout and also in a file where other pgcopydb commands might expect to find it. .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C pgcopydb snapshot: Create and exports a snapshot on the source database usage: pgcopydb snapshot \-\-source ... \-\-source Postgres URI to the source database \-\-dir Work directory to use .ft P .fi .UNINDENT .UNINDENT .SH OPTIONS .sp The following options are available to \fBpgcopydb create\fP and \fBpgcopydb drop\fP subcommands: .INDENT 0.0 .TP .B \-\-source Connection string to the source Postgres instance. See the Postgres documentation for \fI\%connection strings\fP for the details. In short both the quoted form \fB\(dqhost=... dbname=...\(dq\fP and the URI form \fBpostgres://user@host:5432/dbname\fP are supported. .TP .B \-\-dir During its normal operations pgcopydb creates a lot of temporary files to track sub\-processes progress. Temporary files are created in the directory location given by this option, or defaults to \fB${TMPDIR}/pgcopydb\fP when the environment variable is set, or then to \fB/tmp/pgcopydb\fP\&. .TP .B \-\-verbose Increase current verbosity. The default level of verbosity is INFO. In ascending order pgcopydb knows about the following verbosity levels: FATAL, ERROR, WARN, INFO, NOTICE, DEBUG, TRACE. .TP .B \-\-debug Set current verbosity to DEBUG level. .TP .B \-\-trace Set current verbosity to TRACE level. .TP .B \-\-quiet Set current verbosity to ERROR level. .UNINDENT .SH ENVIRONMENT .sp PGCOPYDB_SOURCE_PGURI .INDENT 0.0 .INDENT 3.5 Connection string to the source Postgres instance. When \fB\-\-source\fP is ommitted from the command line, then this environment variable is used. .UNINDENT .UNINDENT .SH EXAMPLES .sp Create a snapshot on the source database in the background: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ pgcopydb snapshot & [1] 72938 17:31:52 72938 INFO Running pgcopydb version 0.7.13.gcbf2d16.dirty from \(dq/Users/dim/dev/PostgreSQL/pgcopydb/./src/bin/pgcopydb/pgcopydb\(dq 17:31:52 72938 INFO Using work dir \(dq/var/folders/d7/zzxmgs9s16gdxxcm0hs0sssw0000gn/T//pgcopydb\(dq 17:31:52 72938 INFO Removing the stale pid file \(dq/var/folders/d7/zzxmgs9s16gdxxcm0hs0sssw0000gn/T//pgcopydb/pgcopydb.aux.pid\(dq 17:31:52 72938 INFO Work directory \(dq/var/folders/d7/zzxmgs9s16gdxxcm0hs0sssw0000gn/T//pgcopydb\(dq already exists 17:31:52 72938 INFO Exported snapshot \(dq00000003\-000CB5FE\-1\(dq from the source database 00000003\-000CB5FE\-1 .ft P .fi .UNINDENT .UNINDENT .sp And when the process is done, stop maintaining the snapshot in the background: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C $ kill %1 17:31:56 72938 INFO Asked to terminate, aborting [1]+ Done pgcopydb snapshot .ft P .fi .UNINDENT .UNINDENT .SH AUTHOR Dimitri Fontaine .SH COPYRIGHT 2023, Dimitri Fontaine .\" Generated by docutils manpage writer. .