Closed jacobwilsonnet closed 1 year ago
Nothing noticeable in the logs when it does its nightly delete.. I turned up the logging and also manually added an entrypoint with--retention
and -vvv
to my compose file:
entrypoint: 'unifi-protect-backup --retention 5d -vvv'
I will see if it deletes correctly tonight
I just tested the functionality and the files are being deleted as expected. What might be happening however is that empty directories are being left behind. Can you check if this is the case?
Hi! thanks for getting back to me and testing the functionality. I think I found my issue. I was basing the timeframe off my timezone and not UTC. Looking at the timestamps on the files, it's starting to make sense. Based on my timezone, the delete runs at 8pm ET. So I would expect 5 days before that to delete. Which it does, for example, this file just barely under 5 days old. I was looking at my ET time on the filename and saying that's bigger than 5 days. So when the service ran at 8pm last night, it wasn't old enough... idk if that makes sense. Sorry for wasting your time, appreciate your quick response and love what you've created!
-rw-r--r-- 1 911 911 7460026 Aug 17 00:01 '2022-08-16T20-01-14 motion.mp4'
You can set the container time zone with the "TZ" env variable. Refer to https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for a list of possible timezones
With that set, the timestamps of the files should match the timestamps of the file names
Description
When I set retention via environment variable, it doesn't appear to follow that. In my docker compose file, I have the retention set to
5d
. However, when the nightly delete happens, it follows the default7d
retention. Aka, folders and all the files that are up to 7 days old stay around. Folders and files older than 7 days are deleted nightly. It's just not following the overwritten value of 5d.Docker compose file:
What I Did
(7 days)