-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Cleanup: Improve logging when deleting related sidecar files #2521
Comments
Not a bug to me. I use to run this command, and it doesn't affect my own files. They simply remove their relatives variable in the database tables. Didi you check if the file's gone and do you now if you deleted it manually yourself? |
I'm a little afraid to experiment with my files. it's be a little difficult to restore previous state. |
so i try, and it actually delete file from original folder. this is definitely not what i expect from this command |
The log message means the related index entry was deleted, not the original file. You are welcome to suggest a better message, but it's very likely not a bug and as such can't be handled with the highest priority. |
so why file actually removed? |
That is what I said. We could change it into "delete: removing orphan index file... * |
I got to the bottom of this and found out that cleanup CAN actually delete physical files, especially sidecar files like JPEGs that are automatically created for a RAW, as well as JSON and YAML sidecar files. This was introduced to save disk space and avoid problems as described in the following issue: The logs are created before anything is actually deleted, so they are not proof that an original was really removed. Note that the cleanup command is intended to remove any remaining artifacts of missing originals, including index entries and sidecar files. So in practice, no original media files should have been deleted, unless the index contains wrong information, e.g. if you put the file there while the cleanup was already running. Nevertheless, I have refactored large parts of the feature to make sure that no files are deleted in originals when delete is disabled or read-only mode is enabled. Note that some users also use the originals folder for the generated sidecar files. For them, we do not want to break the existing functionality. |
Improved logs when you run
|
Signed-off-by: Michael Mayer <michael@photoprism.app>
Signed-off-by: Michael Mayer <michael@photoprism.app>
These improvements can also be tested with the new preview build that is available shortly! 👍 |
work grate, thanks |
1. What is not working as documented?
cleanup Removes orphan index entries and thumbnail files
- i think is meaning that original folder don't be affected.but in log i see
delete: removing file <path to my original folder>
. file extension ismov
2. How can we reproduce it?
run cleanup command.
3. What behavior do you expect?
no files from original folder will be changed.
4. What could be the cause of your problem?
maybe its's wrong logs. I didn't check I don't have a test instance
5. Can you provide us with example files for testing, error logs, or screenshots?
https://gist.github.com/centralhardware/bf3d264beb99c1abe8bc54c1d287a8a8
6. Which software versions do you use?
last docker version
7. On what kind of device is PhotoPrism installed?
does not matter
8. Do you use a Reverse Proxy, Firewall, VPN, or CDN?
does not matter
The text was updated successfully, but these errors were encountered: