support for windows robocopy in archive_command and restore_command - Mailing list pgsql-hackers

From Andrew Dunstan
Subject support for windows robocopy in archive_command and restore_command
Date
Msg-id 7c08ddfd-a90c-2474-a527-c19ffcef99fc@dunslane.net
Whole thread Raw
Responses Re: support for windows robocopy in archive_command and restore_command
List pgsql-hackers
Quite a few years ago Microsoft recognized that with windows copy and
xcopy commands had some serious inadequacies. They therefore created
robocopy <https://ss64.com/nt/robocopy.html> as a replacement, and it
has shipped in all modern versions of Windows. At any rate it's
something I think we should support. Unfortunately it has a couple of
wrinkles. First, it actually returns non-zero in most success
conditions. See <https://ss64.com/nt/robocopy-exit.html> That can be
handled by calling it via a script. But the other thing is that the
calling syntax is different. It's "robocopy sourcedir destdir filename"
It doesn't allow for files to be renamed, but luckily we don't normally
need it to. However, what we do need is the ability to get the directory
name from the %p parameter for archive_command and restore_command,
stripped of the actual file name. I therefore suggest in both cases we
implement a %P escape to allow for it. Should be a pretty tiny patch.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com




pgsql-hackers by date:

Previous
From: "Bossart, Nathan"
Date:
Subject: Re: .ready and .done files considered harmful
Next
From: "alvherre@alvh.no-ip.org"
Date:
Subject: Re: archive status ".ready" files may be created too early