Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyncConfiguration for Pulling all Streams from a Remote Repository #10

Open
ruediste opened this issue May 17, 2015 · 3 comments
Open
Assignees

Comments

@ruediste
Copy link
Owner

The stream patterns in the SyncConfiguration are evaluated against the locally available streams. This leads to the following problem:

From @Polve:

... my problem was precisely to know in advance which remote streams there are to backup. Since the remote server is managed by other people, my goal is to use the backup server to automatically backup all remote streams, even new ones never initialized before.

So I created a little batch file that leverage the "list" command to know the remote streams and add them to the local repo if not already present. The code is similar to this:

cd <myrepo>
for stream in `ssh root@$serverName "cd /repo; btrbck list" | tail -n +2` ; do
  if [ ! -d $stream ]; then
    btrbck create $stream
  fi
done

It would be nice to have this kind of behaviour directly in btrbck itself ....

@Polve
Copy link
Collaborator

Polve commented May 17, 2015

👍

@ruediste
Copy link
Owner Author

I just had a quick look at the sources to get you started. In the SnapshotTransferService, streams get transferred one-by-one. So I guess it is easier to create an additional functionality which separately retrieves the stream list from a remote repository.

Suggestion: add a flag to the list command to switches it to a machine-readable mode, in which it outputs

<START TAG>
<stream name>
<stream name>
....
<END TAG>

with tags like "BTRBCK stream list start".

Then you can create a StreamListTransferService with a listStreams() method similar to SnapshotTransferService.pull() and use it from CliMain.cmdProcess() to retrieve the stream name list.

I'd always read the remote stream names when pulling...

@ruediste
Copy link
Owner Author

Refinement: Instead of a plain text stream name list, create a DTO with the stream name list...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants