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

[Feature request] Backup from stdin #8

Closed
agateblue opened this issue Dec 3, 2019 · 8 comments
Closed

[Feature request] Backup from stdin #8

agateblue opened this issue Dec 3, 2019 · 8 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@agateblue
Copy link
Contributor

Sometimes, simply copying a directory isn't enough for a backup. This happens for instance when you're backing up a SQL database such as MySQL or PostgreSQL: to ensure the backup integrity, you need to use pg_dump and backup the output of that command.

Luckily, restic supports backing up data piped via stdin. Do you think it would be possible to support this in autorestic?

What I currently have in mind is:

locations:
  psqldata:
    command: pg_dumpall

Which autorestic would internally translate to pg_dumpall | restic backup --stdin --stdin-filename psqldata.

I'm going to experiment with that, let me know what you think about it :)

@cupcakearmy
Copy link
Owner

Same with mongodump, might be usefull yes. Altouhgh at least with mongo it's not seen as the reccomended way to go about it.

@cupcakearmy cupcakearmy added the enhancement New feature or request label Dec 3, 2019
@bthj
Copy link

bthj commented Jan 7, 2020

@EliotBerriot , your backup journey article took me here and I'm subscribing to this issue :)

At the risk of hijacking the discussion here, I'd like to ask if you're currently using your own tool, savior, in conjunction with autorestic?

@cupcakearmy
Copy link
Owner

I will do some testing this WE (hopefully I don't forget xD)
might be a bit tricky piping it through node and then to restic, but we'll see.

@agateblue
Copy link
Contributor Author

At the risk of hijacking the discussion here, I'd like to ask if you're currently using your own tool, savior, in conjunction with autorestic?

@bthj no I've completely dropped it, I've been using https://github.com/cupcakearmy/autorestic#before--after-hooks (dump in a before hook, remove the dump in the after hook, backup the dump) as a workaround until we can pipe backups directly to stdin.

I will do some testing this WE (hopefully I don't forget xD)
might be a bit tricky piping it through node and then to restic, but we'll see.

@cupcakearmy yeah, wy first attempts at this (back in december) got stuck at this point unfortunately: piping stdin to a subprocess launched by node.

@cupcakearmy cupcakearmy added the wontfix This will not be worked on label Apr 17, 2020
@cupcakearmy
Copy link
Owner

As this feature is not really relevant anymore and adds significant implementation I will close this. feel free to reopen if necessary

@berlincount
Copy link

I'd prefer to have this reopened.

I'm essentially forced to implement my backup solution without autorestic because dumping a large database to disk inbetween is simply prohibitive :-/

@xpufx
Copy link

xpufx commented Nov 14, 2023

@berlincount A similar tool 'resticprofile' supports backing up from STDIN. I actually have a different problem with it regarding hooks that is not supported and hoped autorestic would fix this situation.

@nser77
Copy link

nser77 commented Jan 3, 2024

Many thanks to @agateblue for raising that.

I personally agree with @berlincount: using the hooks script will create an intermediary file which will increase disk space and decrease security.

Has someone encountered a solution or even a valid alternative?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

6 participants