Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clean up config.json history files #732

Closed
mbierman opened this issue Jun 3, 2020 · 8 comments
Closed

clean up config.json history files #732

mbierman opened this issue Jun 3, 2020 · 8 comments

Comments

@mbierman
Copy link

mbierman commented Jun 3, 2020

Is your feature request related to a problem? Please describe:
config.json.* history files are stored in the top level of a user's homebridge install. This can be cumbersome. (I have over 150 of these files at the moment).

Describe the solution you'd like:
store them in a sub directory by default (e.g. /homebridge/confighistory)

Describe alternatives you've considered:
I can't think of a cleaner solution other than something complex like a database or checking in changes to github, which are overkill.

Additional context:

@oznu
Copy link
Member

oznu commented Jun 3, 2020

There is a button in the UI that deletes all of these. On the config editor tab, click restore, scroll down, then remove old backups.

@mbierman
Copy link
Author

mbierman commented Jun 3, 2020

Yes, but I can imagine someone saying, "I want to be able to revert to previous versions." and still wanting to reduce clutter. Sticking them in a sub folder just seemed like a nice touch. The active file could still be at the root level. But stick edits one level down.

Just a thought.

@stale
Copy link

stale bot commented Jul 3, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 3, 2020
@stale stale bot closed this as completed Jul 9, 2020
@taw123
Copy link

taw123 commented Jul 11, 2020

Perhaps a better refinement of this request might be to keep a rolling history for config.json files. [not going to touch the question of location].

Add a user configurable option to optionally roll off config.json history files automatically by either number files or date (X files, or keep last X days/weeks/months).

Just a thought, if you find yourself with copious free time, not like it isn't hard to add a simple cleanup script hung on cron job myself.... If it really bothered ME 😀

--Tom

@mbierman
Copy link
Author

Agreed. A script isn't complicated but this seems like functionality that should be baked in. I like your suggestion though.

@oznu
Copy link
Member

oznu commented Oct 11, 2020

As of v4.29.0 config backups will be stored in ./backups/config-backups.

The folder path will be created on start - if the path cannot be created and does not already exist (for example, it might be a file), the original storage location will be used and a warning will be shown in the log.

The most recent 100 backup files will be migrated to the new location on the restart following this update.

@mbierman
Copy link
Author

Awesome! Thanks.

oznu added a commit that referenced this issue Oct 27, 2020
@oznu
Copy link
Member

oznu commented Oct 27, 2020

v4.31.0 will complete this task by periodically removing config.json backups older than 60 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants