-
-
Notifications
You must be signed in to change notification settings - Fork 599
fix(backup_service): backup methods use proper paths (#769) #770
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
base: master
Are you sure you want to change the base?
fix(backup_service): backup methods use proper paths (#769) #770
Conversation
I appreciate the explanation, as I must admit I had no clue why the backup behavior followed this design. My goal was to reduce the 'clutter' of nested folders for simple, one-off backups, which is my use case, as I've actuallly never used the local backup from KIAUH and rather rely on a git workflow for that (this has me thinking of a new addition for a helper to set this up automatically lol...).
I hear your concern about consistency, and I think it is absolutely valid. However, I also believe that nesting a single file is not only overkill, but also that the output the backup services gives (unix-path like, without filename at the end) could be quite ambiguous, especially for users that aren't familiar with the cli. What if we keep the current logic but add a 'flatten' check at the end of the backup call/session? If the resulting directory contains only a single file, the script could move that file up one level and remove the redundant folder. The only issue I can think of with this is that I'm not sure how to implement the backup 'session', as it would be quite difficult unless the backup service is modified to explicitely start and stop. We could also potentially run something before exciting the script to check for every file that was backed up during the current run of KIAUH (we then need a logfile for backup transactions in order to avoid recursion throughout a potentially very large backup folder), and flatten if necessary. The only issue with this would be the potential delay introduced (mv is lightning fast anyways..) In any case, I believe the edits to |

Fixes #769
Updated
backup_printer_cfg> docstring + logicbackup_moonraker_conf> docstring + logicbackup_file> proper path for verbose outputtarget_path: removed the code that appendedconfig_{timestamp}target_name: removed the argument as it is was a duplicate of the subcall's logic. Thebackup_filemethod already contains logic to generate a timestamped filename ({stem}_{timestamp}{suffix}) if target_name is omitted.Added a simple docstring to both methods, which could maybe be enhanced ?
Before:
Now:
Edit: modified the docstring to use
{ }instead of< >, as the brackets where being rendered in the docstrings (as html headers..)Edit 2: changed from
destination_pathtotarget_pathto align with the rest of the project