Skip to content

Commit

Permalink
Create pg_xlog/archive_status directory for slave restore.
Browse files Browse the repository at this point in the history
Patch by Mark Kirkwood.
  • Loading branch information
mpihlak committed Jul 21, 2009
1 parent a5af80c commit 38c0e0c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/walmgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ def init_optparse(self, parser=None):
p.set_usage(__doc__.strip())
p.add_option("-n", "--not-really", action="store_true", dest="not_really",
help = "Don't actually do anything.", default=False)
p.add_option("-O", "--overwrite", action="store_true", dest="overwrite",
help = "Overwrite target data directory during backup.", default=False)
return p

def __init__(self, args):
Expand Down Expand Up @@ -1315,6 +1317,10 @@ def restore_database(self):
# restore original xlog files to data_dir/pg_xlog
# symlinked directories are dereferences
self.exec_cmd(["cp", "-rL", "%s/pg_xlog" % bak, data_dir])
else:
# create an archive_status directory
xlog_dir = os.path.join(data_dir, "pg_xlog")
os.mkdir(os.path.join(xlog_dir, "archive_status"), 0700)
else:
data_dir = full_dir

Expand Down

0 comments on commit 38c0e0c

Please sign in to comment.