Feature Request: Allow setting BORG_FILES_CACHE_TTL from config #618

Closed
opened 2022-12-02 08:51:28 +00:00 by sur5r · 6 comments

What I'm trying to do and why

I'm backing up a large file server over a rather slow line. The server contains two sections: active data and archived data. About once a year, stuff is moved from the active area to the archive area. Given the archive area is huge and only growing, it is only backed up once a month. As BORG_FILES_CACHE_TTL defaults to 20, the metadata from the archive area is gone when it's being backup` up again.

Currently, I'm injecting BORG_FILES_CACHE_TTL via systemd. For consistency reasons, I would like to be able to do so from the borgmatic config instead.

Other notes / implementation ideas

I think a key files_cache_ttl next to the existing files_cache would make sense.

Environment

borgmatic version: 1.5.20
borgmatic installation method: Debian package
Borg version: 1.2.2
Python version: 3.9.2
operating system and version: Debian bullseye

#### What I'm trying to do and why I'm backing up a large file server over a rather slow line. The server contains two sections: active data and archived data. About once a year, stuff is moved from the active area to the archive area. Given the archive area is huge and only growing, it is only backed up once a month. As `BORG_FILES_CACHE_TTL` defaults to 20, the metadata from the archive area is gone when it's being backup` up again. Currently, I'm injecting `BORG_FILES_CACHE_TTL` via systemd. For consistency reasons, I would like to be able to do so from the borgmatic config instead. #### Other notes / implementation ideas I think a key `files_cache_ttl` next to the existing `files_cache` would make sense. #### Environment **borgmatic version:** 1.5.20 **borgmatic installation method:** Debian package **Borg version:** 1.2.2 **Python version:** 3.9.2 **operating system and version:** Debian bullseye
Author

I will try and implement this here: https://projects.torsion.org/sur5r/borgmatic/src/branch/filescachettl

Comments and feedback very welcome.

I will try and implement this here: https://projects.torsion.org/sur5r/borgmatic/src/branch/filescachettl Comments and feedback very welcome.
Owner

Lookin' good! Thanks for taking the time to file this and start on the implementation. Here are a few points of feedback:

  • I recommend grouping this option along with the other Borg options that get turned into environment variables, so the user can find them all in one place. Look for borg_keys_directory and similar settings.
  • Also maybe call this borg_files_cache_ttl to emphasize that this corresponds to the environment variable of the same name.
  • Would it be possible to put the environment setting logic in the make_environment() function along with the setting of other Borg environment variables? In fact you probably don't even need to change that function at all.. You can likely just edit the OPTION_TO_ENVIRONMENT_VARIABLE mapping in borgmatic/borg/environment.py.

When you're ready, please feel free to submit this as a pull request. Thanks!

Lookin' good! Thanks for taking the time to file this and start on the implementation. Here are a few points of feedback: * I recommend grouping this option along with the other Borg options that get turned into environment variables, so the user can find them all in one place. Look for `borg_keys_directory` and similar settings. * Also maybe call this `borg_files_cache_ttl` to emphasize that this corresponds to the environment variable of the same name. * Would it be possible to put the environment setting logic in the `make_environment()` function along with the setting of other Borg environment variables? In fact you probably don't even need to change that function at all.. You can likely just edit the `OPTION_TO_ENVIRONMENT_VARIABLE` mapping in `borgmatic/borg/environment.py`. When you're ready, please feel free to submit this as a pull request. Thanks!
witten added the
good first issue
label 2023-02-04 17:15:54 +00:00
Owner

@Soumik_Dutta swooped in and implemented this! The feature will be part of the next release.

@Soumik_Dutta swooped in and implemented this! The feature will be part of the next release.
Author

I completely forgot about this. Thanks everyone!

I completely forgot about this. Thanks everyone!
Owner

Apparently we did too. 😄

Apparently we did too. 😄
Owner

Released in borgmatic 1.7.10!

Released in borgmatic 1.7.10!
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#618
No description provided.