Cleaning scratch & work directories

Mike McLean mikem at redhat.com
Thu Jan 20 23:31:15 UTC 2011


On 01/20/2011 05:05 PM, Anthony Messina wrote:
> I'm continuing work a on a private Koji instance (Kerberos) and am now
> working on automating cleanup, etc.
>
> It is mentioned here
> http://lists.fedoraproject.org/pipermail/buildsys/2010-December/003415.html
> that "Koji leaves it to the administrator to clean out the scratch build
> directory."
>
> Is there anything special about cleaning up scratch builds or the
> work/{cli-build,cli-import,tasks} directories for that matter?
>
> Do I need to interact with the Koji database in any way to let koji know
> these files are gone? What I mean is, can I simply remove the files and
> directories without any Koji integration?

The contents of work and scratch are not tracked in the database. The 
mechanism I use is a simple cron job that simply looks at modification 
times.

The main things you want to watch out for is deleting things too early. 
Scratch builds aren't much use to anyone if you delete them before the 
builder gets a chance to poke at them. The work directory is used as a 
temporary holding zone by some tasks, so you don't want to delete stuff 
out from under a running task. A reasonable time-based check is 
sufficient to avoid this.

In my koji instance we keep content under work/ for two weeks and 
content under scratch/ for one week.

Using tmpwatch is a another possibility. I believe it looks at access 
times by default.


More information about the buildsys mailing list