RMS icon indicating copy to clipboard operation
RMS copied to clipboard

`frame_days_to_keep` only delete processed files but not the raw images

Open Cybis320 opened this issue 6 months ago • 4 comments

Currently, frame_days_to_keep only deletes processed files but not raw images. I think it was deemed sufficient because those images were supposed to be archived or deleted. Currently, they are supposed to be deleted after the code is done generating timelapse from them. However, there are clearly cases where this isn't happening (for various reasons.)

Ideally, frame_days_to_keep should delete the specified number of days by deleting relevant <hour> directories but always preserve the last 24 hr to produce timelapses.

Cybis320 avatar Jun 10 '25 22:06 Cybis320

Hi Cybis320,

Thanks for assigning to me, however I think that the quota management system already cleans up the raw images, if it is enabled.

I saw this problem, which is why I extended the quota management system to handle

 delete_list = objectsToDeleteByTime(config.data_dir,
                                        [config.frame_dir, config.times_dir, config.video_dir],
                                        config.continuous_capture_quota)

I think the case you are considering does not have quota management enabled. It would be interesting to see if this would tackle the problem.

g7gpr avatar Jun 10 '25 23:06 g7gpr

Sorry Cybis320, I'm not familiar with the code which processes frame_days_to_keep, or the directory structure for the raw images. The quota management system obliterated everything before a cut off date, and was intended as a backstop.

I can keep working on this, but I suspect the original author of this section of code would resolve it much more efficiently.

g7gpr avatar Jun 10 '25 23:06 g7gpr

Oops, I wrongly assumed it was you. I take a dig at it. And yes, quota management should do the job nicely, but if it's disabled, I think it makes sense for frame_days_to_keep to handle this too - I've never verified QM on this case.

Cybis320 avatar Jun 10 '25 23:06 Cybis320

QM was extended to cover this exact situation, which occurred a few times during the development work, so QM makes a list of all the files in all the directories, sorts by time, and obliterates the oldest until under quota. It's not very intelligent, but since the development work has been completed, I don't recall seeing it operate.

g7gpr avatar Jun 10 '25 23:06 g7gpr