Passing password passphrase to borgmatic inside a bash script. #363

Closed
opened 2020-10-28 02:35:58 +00:00 by annata83 · 2 comments

The Original recomended systemd method dosn't work for me; trying to execute a systemd service from a script but bormatic ask for password passphrase when executing a backup.
I would love to use an alias with something like Pass( The Linux Pasword Manager ) in the lines of:
pass_import=pass show borgmatic | head -n1
that would promp for my master password and grab the password for my encypted borgmatic passphrase... thing is is it possible to pass that to borgmatic so it dosent need user input during execution?

borgmatic version: [1.5.10]

borgmatic installation method: [AUR]

Borg version: [1.1.13]

Python version: [3.8.5]

operating system and version: [Arch Linux]

The Original recomended systemd method dosn't work for me; trying to execute a systemd service from a script but bormatic ask for password passphrase when executing a backup. I would love to use an alias with something like Pass( The Linux Pasword Manager ) in the lines of: pass_import=`pass show borgmatic | head -n1 ` that would promp for my master password and grab the password for my encypted borgmatic passphrase... thing is is it possible to pass that to borgmatic so it dosent need user input during execution? **borgmatic version:** [1.5.10] **borgmatic installation method:** [AUR] **Borg version:** [1.1.13] **Python version:** [3.8.5] **operating system and version:** [Arch Linux]
Owner

Thanks for the question! Have you tried the encryption_passcommand option? It would look something like this in borgmatic's configuration:

storage:
    encryption_passcommand: "pass show borgmatic"

However, I don't believe the | head -n1 portion will work, because Borg doesn't support running actual shell commands like that to get the passphrase. However, Borg does have an example using pass directly: https://borgbackup.readthedocs.io/en/stable/quickstart.html#passphrase-notes

So maybe give that a shot, and if that doesn't work, Borg's documentation needs updating to show a working pass example (if possible)?

Thanks for the question! Have you tried the `encryption_passcommand` option? It would look something like this in borgmatic's configuration: ```yaml storage: encryption_passcommand: "pass show borgmatic" ``` However, I don't believe the `| head -n1` portion will work, because Borg doesn't support running actual shell commands like that to get the passphrase. However, Borg does have an example using `pass` directly: https://borgbackup.readthedocs.io/en/stable/quickstart.html#passphrase-notes So maybe give that a shot, and if that doesn't work, Borg's documentation needs updating to show a working `pass` example (if possible)?
witten added the
question / support
label 2020-10-28 04:18:25 +00:00
Owner

Closing due to inactivity. However, please feel free to reopen if you'd like to discuss further.

Closing due to inactivity. However, please feel free to reopen if you'd like to discuss further.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#363
No description provided.