restic versionrestic 0.9.1 compiled with go1.10.3 on linux/amd64
pg_dump database | restic -r /tmp/restic-repo backup --stdin --stdin-filename prod.sql
Error output:
Fatal: wrong password or no key found
restic -r /tmp/restic-repo init
pg_dump database | restic -r /tmp/restic-repo backup --stdin --stdin-filename prod.sql
I think that's how its supposed to work, you can't enter a password, as anything going to stdin will get backed up. Two alternatives are that you can create a file with the password in and then set this:
$ echo "1234" > /my/password/file
$ export RESTIC_PASSWORD_FILE=/my/password/file
or use the '-p' option
$ restic -p /my/password/file backup --stdin ...
Oh, thanks for the hint on the issue! I think we can add a message to restic, stating that it reads the password from stdin if it detects that stdin is not a terminal, like this:
$ echo foo | ./restic backup .| cat restic-password-stdin-message ✱
read password from stdin
Files: 0 new, 0 changed, 51 unmodified
Dirs: 0 new, 0 changed, 0 unmodified
Added to the repo: 0 B
processed 51 files, 23.997 MiB in 0:00
snapshot ca278fd1 saved
It's only shown when stdin is a terminal, otherwise the user is queried for the password normally.
Most helpful comment
I think that's how its supposed to work, you can't enter a password, as anything going to stdin will get backed up. Two alternatives are that you can create a file with the password in and then set this:
or use the '-p' option