-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fix file write encoding errors #203
base: dev
Are you sure you want to change the base?
Conversation
Version update 1.2.4
In rare cases a container image requires binding a file directly, which the script takes as source_dir for the backup. This adds a check, if the directory the scripts grabs is a filename and strips the filename. i.e. ./backup_appdata.sh: line 185: cd: /appdata/container/container.conf/..: Not a directory stripes the filename (container.conf), so the script backups /appdata/container/ and its content properly.
…atch-1 Make backup_appdata work if container needs file binds
You got UnicodeException when writing tables to the log file. This fixes that by explicitly setting the encoding to utf-8.
When getting to max logs, you would get an exception where it tries to rename a file into an existing file. I have fixed this by replacing the entire rotation logic with my own, inspired by my own logging framework in Python. This is proven to work.⚠️ I have not tested if this works in a Docker configuration.⚠️
Automatic Jetbrains IDEA Ultimate run to remove unnecessary imports (useful for decluttering)
Apparently my own solution did not work for log files above 9... I worked this out now.
⚠️ Your conf name through rclone has to be "daps" in order for this to work correctly.⚠️
Apparently the automatic optimization of imports by Jetbrains failed for the first time and deleted some necessary json imports, lol
This is for now better for flow control. Later on I will work on creating a more efficient command executor. (also added some debug log statements)
That way it doesn't need to iterate over all directories multiple times, I noticed a slow-down here, so I implemented this to prevent that. For now will only work on my machine since I am the only one with such a json file. Feel free to standardize this into the libraries themselves.
As there are tons of changes to this and some of them seem custom I'm curious how this work with docker users. Further I'm more inclined to push this to the dev branch for further testing when I get time in which I'm not sure when I'll have that as recently or the past while I've not had time to do much. |
No worries man. I wrote it primarily for myself and shared in case others find it useful. Feel free to take your time, push it to the dev branch or reject it altogether (: Glad for all your work |
You got UnicodeException when writing tables to the log file. This fixes that by explicitly setting the encoding to utf-8.
Also fixes the logger rotation, see commit description.