The plan is not to restore straight from the data folder. I'm creating a script that:
1- Create a backup of all dbs 2- Rezip backups with AES256 encryption 3- Copies the encrypted backups to a remote location.
The double call works. The shell script didn't respond well to a redirect. I haven't tried the forward yet. I just thought there would be a way to do it in one operation. For this case, lag is not much of an issue because it's a shell and it's internal, but I've had similar cases in web applications with other functions, so I asked.
On Fri, Apr 21, 2017 at 4:26 AM, Christian Grün christian.gruen@gmail.com wrote:
So I need to send 2 separate http requests or use a redirect?
- Send request that creates backups
- Send request that extracts the latest backup name from the list of
all
backups and returns it to me?
Exactly.
I'm getting a lot of lag in my applications from having to perform so
many
calls or redirects to get anything from the server after an update.
If the redirection should really turn out to be a lag (I wouldn’t hope so, because such a call should be really cheap), simply use rest:forward instead of rest:redirect [1].
Or maybe you have a better approach to propose?
Maybe you don’t really need the exact name of the backup, because db:restore can be called without timestamp [2].
Best, Christian
[1] http://docs.basex.org/wiki/RESTXQ#rest:forward [2] http://docs.basex.org/wiki/Database_Module#db:restore