Can't run from cron on Mac


I’m having issues with running kopia from cron. It works fine if I use it from the CLI normally, but I’m getting this error from cron logs:

Enter password to open repository: stty: stdin isn’t a terminal
stty: stdin isn’t a terminal

kopia: error: open repository: get password: can’t get password, try --help

Source code of my cron:

0 11 * * 1-5 $HOME/bin/ >>/tmp/backup.log 2>&1

Source code of my backup script:

#!/usr/bin/env bash
cd "$HOME"
kopia snap create .dotfiles

You can try reconnecting to repository using —no-keychain parameter. This will store the password in a file instead of keychain. Let me know if that works.

I suspect keychain is not available on cron because it requires login password to unlock.

Sorry for the late reply @jkowalski, I never ended up getting back to this till now.

I’ve just tried now on Kopia 0.8.4, and I’m getting the error "unknown long flag “–no-keychain”. Command used is below:

kopia repo connect filesystem --path "PATH" --no-keychain

Should I try the “–persist-credentials” flag instead?

I believe the correct name for the long flag is --no-use-keychain.