# Can't run from cron on Mac

**URL:** <https://kopia.discourse.group/t/cant-run-from-cron-on-mac/207>\
**Category:** Support\
**Created:** [November 23, 2020, 12:57am UTC](https://kopia.discourse.group/t/cant-run-from-cron-on-mac/207 "2020-11-23T00:57:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amir](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/amir/32/63_2.png) [@Amir](https://kopia.discourse.group/u/Amir)\
**Post date:** [November 23, 2020, 12:57am UTC](https://kopia.discourse.group/t/cant-run-from-cron-on-mac/207/1 "2020-11-23T00:57:08Z")

</div>

Hi,

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:

```
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
0 11 * * 1-5 $HOME/bin/backup.sh >>/tmp/backup.log 2>&1

```

Source code of my backup script:

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

---

<div class="post-metadata">

**Author:** ![jkowalski](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/jkowalski/32/3_2.png) [@jkowalski](https://kopia.discourse.group/u/jkowalski)\
**Post date:** [November 23, 2020, 2:40pm UTC](https://kopia.discourse.group/t/cant-run-from-cron-on-mac/207/2 "2020-11-23T14:40:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Amir](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/amir/32/63_2.png) [@Amir](https://kopia.discourse.group/u/Amir)\
**Post date:** [May 31, 2021, 3:21am UTC](https://kopia.discourse.group/t/cant-run-from-cron-on-mac/207/3 "2021-05-31T03:21:37Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![martinpk](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@martinpk](https://kopia.discourse.group/u/martinpk)\
**Post date:** [June 27, 2023, 2:16pm UTC](https://kopia.discourse.group/t/cant-run-from-cron-on-mac/207/4 "2023-06-27T14:16:05Z")

</div>

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