#10726 Monthly cron job to clean up old koji trees for EPEL8/EPEL8-next
Closed: Fixed with Explanation 2 years ago by kevin. Opened 2 years ago by smooge.

Currently every day the rhel8-split.sh and cent8-split.sh creates a new hardlinked tree of files in /mnt/fedora/app/fi-repo/rhel/rhel8/koji/ and /mnt/fedora/app/fi-repo/centos/stream8-kojitarget. This adds up over time in hardlink counts on various files and makes looking at those directories ugly.

What is needed is a once a month cron job that removes all the directories from the month before. This will allow a smaller directory listing and also faster ls/find on certain trees. This cron job would be in ansible tree roles/grobisplitter/files and would be run on batcave01.


Metadata Update from @zlopez:
- Issue priority set to: Waiting on Assignee (was: Needs Review)
- Issue tagged with: low-gain, low-trouble, ops

2 years ago

Something like find /mnt/fedora/app/fi-repo/rhel/rhel8/koji/ /mnt/fedora/app/fi-repo/centos/stream8-kojitarget -mindepth 1 -maxdepth 1 -type d -mtime +30 -print -exec rm -rf '{}' \; should work. It will find all the daily subdirectories that are 31 days or older and delete them. It can be run on a monthly cron job or even at the end of the *-split.sh scripts each day. I suppose I could submit a PR, but it would be nice if someone with actual access could make sure it works as expected.

Thanks for the tip @gotmax23 , tried your suggestion and it seems to work just fine.
I added a line in both cron files executing the command.
Here is the PR: https://pagure.io/fedora-infra/ansible/pull-request/1109

I merged the pr and pushed it out. Thanks everyone!

Metadata Update from @kevin:
- Issue close_status updated to: Fixed with Explanation
- Issue status updated to: Closed (was: Open)

2 years ago

Log in to comment on this ticket.

Metadata
Boards 1
ops Status: Backlog