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

sshd on borgmatic container? #98

Closed
Sdub76 opened this issue Feb 15, 2022 · 4 comments
Closed

sshd on borgmatic container? #98

Sdub76 opened this issue Feb 15, 2022 · 4 comments

Comments

@Sdub76
Copy link

Sdub76 commented Feb 15, 2022

I have 2 docker containers running this borgmatic image that I'd like to be able to back up to each other. This container has an SSH client but does not appear to have the SSH server component.

My workaround is to install the borg binary to the OS base image but I'd rather just have the 2 docker containers talk directly to each other.

Is there a way to add this without the openssh server being added to the docker image?

@grantbevis
Copy link
Collaborator

Hi I’ve been thinking about this one and I think it’s out of the scope of this project.

I wrote this years ago to solve the problem you have, it’s kinda old and probably not as good as it could be but check out https://github.com/b3vis/borg-server

@Sdub76
Copy link
Author

Sdub76 commented Feb 20, 2022

I was giving this some more thought... could you edit your config.yaml file and add the line:

# Alternate Borg remote executable. Defaults to "borg".
    remote_path: ssh root@192.168.1.2 docker exec borgmatic borg

Where 192.168.1.2 is the IP of the server that you're trying to backup to? As long as the host running docker has a working SSH daemon it seems like this might work.

@Sdub76
Copy link
Author

Sdub76 commented Feb 20, 2022

Actually, I take that back... that would be redundant to the SSH command that's built in for remote repos... something like this might work in your config.yaml...

   repositories:
        - 192.168.1.2:/borg_repo
   remote_path: docker exec borgmatic borg

I'll give it a try and report back

@Sdub76
Copy link
Author

Sdub76 commented Feb 20, 2022

Didn't work... I think the nature of how docker exec commands execute doesn't allow the executable to continue running.

with "docker exec borgmatic borg", I got:

192.168.1.2:/borg-repo: Error running actions for repository
Got unexpected RPC data format from server:
Borg 1.1.17: Got connection close before repository was opened.

with "docker exec -it borgmatic borg", I got:

192.168.1.2:/borg-repo: Error running actions for repository
Remote: the input device is not a TTY
Connection closed by remote host. Is borg working on the server?

with "docker exec -t borgmatic borg", I got:

192.168.1.2:/borg-repo: Error running actions for repository
Connection closed by remote host. Is borg working on the server?

Figured it was worth putting here in case someone else searches for the same, or has a better idea.

@Sdub76 Sdub76 closed this as completed May 8, 2022
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