itzg / docker-mc-backup

Provides a side-car container to backup itzg/minecraft-server world data
https://hub.docker.com/r/itzg/mc-backup
MIT License
334 stars 52 forks source link

tar: fixed precision of PRUNE_BACKUPS_DAYS to correctly prune at the day value given #206

Closed itzg closed 1 month ago

itzg commented 1 month ago

It turns out the precision of -mtime is a bit fuzzy where a value of 1 ends up matching files older than 2 days:

When find figures out how many 24-hour periods ago the file was last accessed, any fractional part is ignored, so to match -atime +1, a file has to have been accessed at least two days ago.

Using -mmin instead, which now also allows for fractional values of PRUNE_BACKUPS_DAYS

Reported in Discord