A directory contains several backup subdirectories named after their creation date and time [format: YYYY-MM-DD-HHMMSS], like:
2017-12-17-211627 2017-12-17-231437 2017-12-18-001330 2017-12-18-003359
2017-12-18-004740 2017-12-18-010948 2017-12-17-231307 2017-12-17-235559
2017-12-18-001623 2017-12-18-003824 2017-12-18-004857
The goal is to do thinning/retention and keep only:
- 1 folder per hour for the first 24 hours,
- 1 folder per day for the rest of the month, and
- 1 folder per week for older history.
Need a list of folder names to run a btrfs subvolume delete ...
on, within a bash shell script.
Are there ready made tools/utilities or bash scripts that do thin these kind of directories?