Skip to content

Commit 717ee59

Browse files
authored
Merge pull request #1554 from geofabrik/update-osm2pgsql-replication
Update docs on making `osm2pgsql-replication` man page
2 parents bd7b444 + 26583c2 commit 717ee59

2 files changed

Lines changed: 38 additions & 2 deletions

File tree

CONTRIBUTING.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,15 @@ The [osm2pgsql man page](docs/osm2pgsql.1) can be built from [source](docs/osm2p
6363
with `make man`. The [osm2pgsql-replication man page](docs/osm2pgsql-replication.1)
6464
has been built with:
6565

66-
argparse-manpage --pyfile scripts/osm2pgsql-replication --function get_parser
66+
argparse-manpage --pyfile scripts/osm2pgsql-replication --function get_parser --project-name osm2pgsql-replication --url osm2pgsql.org > docs/osm2pgsql-replication.1
67+
68+
This command can be installed with:
69+
70+
```sh
71+
sudo apt-get install python3-argparse-manpage
72+
```
73+
74+
Remove the `.SH AUTHORS` section which this command adds.
6775

6876
Results should be checked into the repository.
6977

docs/osm2pgsql-replication.1

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,30 @@ Any additional arguments to osm2pgsql need to be given after '\-\-'. Database
128128
and the prefix parameter are handed through to osm2pgsql. They do not need
129129
.br
130130
to be repeated. '\-\-append' and '\-\-slim' will always be added as well.
131+
.br
132+
133+
.br
134+
Use the '\-\-post\-processing' parameter to execute a script after osm2pgsql has
135+
.br
136+
run successfully. If the updates consists of multiple runs because the
137+
.br
138+
maximum size of downloaded data was reached, then the script is executed
139+
.br
140+
each time that osm2pgsql has run. When the post\-processing fails, then
141+
.br
142+
the entire update run is considered a failure and the replication information
143+
.br
144+
is not updated. That means that when 'update' is run the next time it will
145+
.br
146+
recommence with downloading the diffs again and reapplying them to the
147+
.br
148+
database. This is usually safe. The script receives two parameters:
149+
.br
150+
the sequence ID and timestamp of the last successful run. The timestamp
151+
.br
152+
may be missing in the rare case that the replication service stops responding
153+
.br
154+
after the updates have been downloaded.
131155

132156
.TP
133157
\fBparam\fR
@@ -149,6 +173,10 @@ Path to osm2pgsql command (default: osm2pgsql)
149173
\fB\-\-once\fR
150174
Run updates only once, even when more data is available.
151175

176+
.TP
177+
\fB\-\-post\-processing\fR SCRIPT
178+
Post\-processing script to run after each execution of osm2pgsql.
179+
152180
.TP
153181
\fB\-q\fR, \fB\-\-quiet\fR
154182
Print only error messages
@@ -179,5 +207,5 @@ Prefix for table names (default 'planet_osm')
179207

180208
.SH DISTRIBUTION
181209
The latest version of osm2pgsql\-replication may be downloaded from
182-
.UR <<UNSET \-\-url OPTION>>
210+
.UR osm2pgsql.org
183211
.UE

0 commit comments

Comments
 (0)