<br><br><div><span class="gmail_quote">On 3/6/06, <b class="gmail_sendername">Justin Conover</b> <<a href="mailto:justin.conover@gmail.com">justin.conover@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="direction: ltr;"><br><br><div></div><div style="direction: ltr;"><span class="e" id="q_109d1533a1d9fc46_1"><span class="gmail_quote">On 3/6/06, <b class="gmail_sendername">David Timms</b> <<a href="mailto:dtimms@bigpond.net.au" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
dtimms@bigpond.net.au</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Justin Conover wrote:<br>> On 3/6/06, David Timms <<a href="mailto:dtimms@bigpond.net.au" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">dtimms@bigpond.net.au</a>> wrote:<br>>> I've tried to find a way to clean up all the old headers and downloaded
<br>>> RPMs that accumulate in /var/cache/yum
<br>>><br>...<br>>> What I want is to erase (the thousands of) superseded header files that<br>>> are no longer current, leaving with only the current headers from repo,<br>>> and also delete the superseded rpm files (probably another 1000-2000
<br>>> files and 1.5 to 2 GB of data), ie if the rpm is not in the current repo<br>>> file list, then delete it for each repo.<br> ><br>> I don't think you can have your cake and eat it to.<br>Why not, it's only programming - the repo info files contain all the
<br>information that a tool would need. a. Create list of current rpms. b.<br>Create file list of the yum package directory. c. for each item in b<br>that is not in a, erase both hdr + rpm ?<br>><br>> It takes like 10-30 seconds to get all the header files if you start over, I
<br>> don't think your going to find away to exclude/keep only certian<br>> header/rpm's unless you manually go through it.<br>Perhaps something as "simple" as using xargs in a script ?<br><br>> Besides, if you only want to keep what is current on the server, what would
<br>> is it you want to accomplish with that?<br>I am trying to test on as many machines as possible, and bandwidth is<br>not free, nor is it fast (I am on a capped plan - once I get to my<br>monthly limit I get slowed to modem speed!) For example to get from
<br>FC5T3 to rawhide, the downloads of headers might take 5 minutes (@<br>512kb). But more importantly, why unnecessarily waste internet / mirrors<br>bandwidth ?<br><br>> Packages are already installed, so<br>> you don't really need them lying around,
<br>I set up my main machine with heaps of storage to store all the hdr/rpm<br>as normal. I then pupdate the main machine just before I do the<br>following. On each new machine I test on, I run an rsync to mirror the<br>
yum folder to the new machine, quite simple really, but copying 4000
<br>files (2G of files) that aren't relevant and have long been superseded<br>is such a waste of my time.<br><br>> if it is because your running<br>> rawhide and might need to fall back, than keep the packages for a few and
<br>> blow everything out.<br>I can see a reason while on the devel repo to keep some old packages,<br>but I'm far more concerned that my machines end up with no disk space.<br>Especially bad on any older/low-disk machines that I have tried. Having
<br>to decide on erasing thousands of individual files manually is not my<br>idea of fun.<br><br>Anyhow, thanks for you ideas Justin,<br><br>DaveT.<br><br>--</blockquote></span></div><div style="direction: ltr;"><div><br>

<br>
Ok, I understand why you want to do what you want to do (or something like that )  ;-)<br>
<br>
you could do this<br>
<br>
find /var/cache/yum/development/headers -mtime +3 -exec rm -f {} \;<br>
find /var/cache/yum/development/packages -mtime +3 -exec rm -f {} \;<br>
find /var/cache/yum/extras-development/headers -mtime +3 -exec rm -f {} \;<br>
find /var/cache/yum/extras-development/packages -mtime +3 -exec rm -f {} \;<br>
</div><br>
<br>
E.G.<br>
<br>
find /var/cache/yum/development/headers -mtime +3 | wc -l<br>
35<br>
<br>
find /var/cache/yum/development/headers -mtime +3 | wc -l<br>
0<br>
<br>
 find /var/cache/yum/development/headers -mtime +2 | wc -l<br>
38<br>
<br>
Notices I used 2 the last time.<br>
<br>
This should work for what you are wanting to do and you could drop all those in a script too.<br>
<br>
Keep in mind that the "+3" in -mtime means anything 4 days and older, so adjust that to your liking.<br></div><br>

</div></blockquote></div><br>
<br>
Just for clarity, this one<br>
<br>

find /var/cache/yum/development/headers -mtime +3 | wc -l<br>
<div style="direction: ltr;">
0<br>
<br>
was after this was ran<br>
<br>

find /var/cache/yum/development/headers -mtime +3 -exec rm -f {} \;<br>
</div>
<br>
<br>