Snapshotting a directory from STDIN?


I’m thinking about automating some application snapshotting, and it would be really convenient if I could create snapshots structured as a directory of files without writing copies of the content to disk first.

How complex would it be to make something like this work:

tar cvf - * | restic backup --stdin --tar

What I have in mind specifically is building a script that would run mysqldump on one table at a time and generate a tar stream looking like ${DATABASE}/${TABLE}.sql. This would make it really quick for me to restore individual tables from any snapshot, and with --stdin I wouldn’t have to worry about having enough disk space and IO available outside the restic repo to dump all databases to at the same time first.

This would also offer a really nice path for migrating existing tar backups to restic snapshots

Edit: Finally found a few past references to this idea:


This is a good idea and has indeed been proposed several times already, here’s another one:

I think we need to decouple this from backup/restore and make two new commands: import and export, which imports from and exports to e.g. tar files.

The pieces are in place so far and @matt offered to do the export part, so it “just” needs to be done :stuck_out_tongue:


Ah, just a Small Matter of Programming then! :slight_smile:

I take it the refactor previously mentioned as making it easier to implement has happened already?


It has, but at the moment we have several big things to work on, so it’s not something I would start right now. So don’t get your hopes up that this will be added near-term :wink:


Is this feature request tracked on GitHub?