nils-werner / crestic

Configurable Restic Wrapper
https://nils-werner.github.io/crestic/
MIT License
105 stars 10 forks source link

password-command fails if arguments in string? #29

Closed greg-minshall closed 2 years ago

greg-minshall commented 2 years ago

hi. thanks still much for crestic.

i get this error

bash archlinux (master): {49764} crestic lemur@ca-lacie-rugged-c stats
Resolving password failed: fork/exec pass backups/restic/california/0bee4de5-909a-468b-99e6-f4a899f3beb3: no such file or directory

the relevant (i think) bits of my crestic.cfg are

[@ca-lacie-rugged-c]
repo: /mnt/restic/repos/0bee4de5-909a-468b-99e6-f4a899f3beb3/restic
password-command: "pass backups/restic/california/0bee4de5-909a-468b-99e6-f4a899f3beb3"

[lemur@.backup]
arguments: ~

with CRESTIC_DRYRUN:

bash archlinux (master): {49765} CRESTIC_DRYRUN=1 crestic lemur@ca-lacie-rugged-c stats
             Warning: Executing in debug mode. restic will not run, backups are not touched!
        Config files: /home/minshall/.config/crestic/crestic.cfg, /etc/xdg/crestic/crestic.cfg
   Config files used: /home/minshall/.config/crestic/crestic.cfg
     Config sections: global, global.stats, @ca-lacie-rugged-c, @ca-lacie-rugged-c.stats, lemur@, lemur@.stats, lemur@ca-lacie-rugged-c, lemur@ca-lacie-rugged-c.stats
Config sections used: global, @ca-lacie-rugged-c
        Env sections: global.environ, global.stats.environ, @ca-lacie-rugged-c.environ, @ca-lacie-rugged-c.stats.environ, lemur@.environ, lemur@.stats.environ, lemur@ca-lacie-rugged-c.environ, lemur@ca-lacie-rugged-c.stats.environ
   Env sections used:
    Expanded command: restic stats --repo /mnt/restic/repos/0bee4de5-909a-468b-99e6-f4a899f3beb3/restic --password-command "pass backups/restic/california/0bee4de5-909a-468b-99e6-f4a899f3beb3"

and, if i copy and paste the "Expanded command" (thanks for which!) into my shell

bash archlinux (master): {49766} restic stats --repo /mnt/restic/repos/0bee4de5-909a-468b-99e6-f4a899f3beb3/restic --password-command "pass backups/restic/california/0bee4de5-909a-468b-99e6-f4a899f3beb3"
gpg: Note: sender requested "for-your-eyes-only"
Fatal: unable to open config file: stat /mnt/restic/repos/0bee4de5-909a-468b-99e6-f4a899f3beb3/restic/config: no such file or directory
Is there a repository at the following location?
/mnt/restic/repos/0bee4de5-909a-468b-99e6-f4a899f3beb3/restic

(i haven't yet done the init, having run into this.)

any ideas, things i, crestic, restic, might be doing wrong?

nils-werner commented 2 years ago

I don't think you should provide the command in extra quotes.

greg-minshall commented 2 years ago

I don't think you should provide the command in extra quotes.

thanks -- that did it.

did this behavior change recently? i've been using the quotes since i started using crestic a few years ago, and it only failed in the last few weeks.

cheers.

nils-werner commented 2 years ago

Not on our end, maybe restic changed it?

greg-minshall commented 2 years ago

ah, yeah -- likely. again, thanks.