# Log retention - which commands? How to set permanently?

**URL:** <https://kopia.discourse.group/t/log-retention-which-commands-how-to-set-permanently/997>\
**Category:** Support\
**Created:** [March 24, 2022, 6:34am UTC](https://kopia.discourse.group/t/log-retention-which-commands-how-to-set-permanently/997 "2022-03-24T06:34:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eyalzvi](https://avatars.discourse-cdn.com/v4/letter/e/bcef8e/32.png) [@eyalzvi](https://kopia.discourse.group/u/eyalzvi)\
**Post date:** [March 24, 2022, 6:34am UTC](https://kopia.discourse.group/t/log-retention-which-commands-how-to-set-permanently/997/1 "2022-03-24T06:34:01Z")

</div>

The documentation mentions log retention policies (–log-dir-max-files etc.), but which commands accepts those flags?

Is there a way to set the flags permanently in the config file and or policies?

---

<div class="post-metadata">

**Author:** ![kees](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/kees/32/266_2.png) [@kees](https://kopia.discourse.group/u/kees)\
**Post date:** [March 24, 2022, 10:49am UTC](https://kopia.discourse.group/t/log-retention-which-commands-how-to-set-permanently/997/2 "2022-03-24T10:49:49Z")

</div>

I guess `kopia set policy ...`, although I don’t see it in the `--help` info

---

<div class="post-metadata">

**Author:** ![iBackup](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/ibackup/32/355_2.png) [@iBackup](https://kopia.discourse.group/u/iBackup)\
**Post date:** [March 24, 2022, 11:53am UTC](https://kopia.discourse.group/t/log-retention-which-commands-how-to-set-permanently/997/3 "2022-03-24T11:53:40Z")

</div>

> [@eyalzvi](#):
>
> but which commands accepts those flags?

I’m not an expert in GoLang, but it looks from source code that  
it should be given directly to `kopia --log-dir-max-files=1 kopia_command ...`

> [@eyalzvi](#):
>
> Is there a way to set the flags permanently in the config file and or policies?

I can’t see it in code or docs, so I think it should be used as an argument to `kopia`

---

<div class="post-metadata">

**Author:** ![iBackup](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/ibackup/32/355_2.png) [@iBackup](https://kopia.discourse.group/u/iBackup)\
**Post date:** [March 24, 2022, 11:56am UTC](https://kopia.discourse.group/t/log-retention-which-commands-how-to-set-permanently/997/4 "2022-03-24T11:56:35Z")

</div>

> [@kees](#):
>
> I don’t see it in the `--help` info

There’s more useful options: `--help-long` that extracts almost all

---

<div class="post-metadata">

**Author:** ![eyalzvi](https://avatars.discourse-cdn.com/v4/letter/e/bcef8e/32.png) [@eyalzvi](https://kopia.discourse.group/u/eyalzvi)\
**Post date:** [March 24, 2022, 12:54pm UTC](https://kopia.discourse.group/t/log-retention-which-commands-how-to-set-permanently/997/5 "2022-03-24T12:54:13Z")

</div>

Ok, filed an issue to add log storage and retention settings to config and/or policies: [Add log retention settings to config or policies · Issue #1847 · kopia/kopia · GitHub](https://github.com/kopia/kopia/issues/1847)
