<div dir="ltr"><div><div><div><div>Hello folks, good morning<br><br></div>I'll check the code asap, but I would like to share some tricks. If you are looking for some improvement, feel free to access the link [1] or just access the project link [2] and then click on Issues tab, after that just clock on New Issue and describe the problem. The owner of this project will receive the request and all guys who will work with this code will be able to help on this improvement.<br><br></div>Welcome to the opensource. :)<br><br></div>Another trick to claim storage is run vacuum on the postgres db just to reorder the db and shrink when necessary. Basically when you sync some repos, the data file *from DB* will increase, when you delete the data from db, the data file still with the same size.<br><br></div>Best<br><div><div><div><br>[1]. <a href="https://github.com/00willo/spacewalk-scripts/issues">https://github.com/00willo/spacewalk-scripts/issues</a><br>[2]. <a href="https://github.com/00willo/spacewalk-scripts">https://github.com/00willo/spacewalk-scripts</a><br>[3]. <a href="https://www.postgresql.org/docs/9.5/static/sql-vacuum.html">https://www.postgresql.org/docs/9.5/static/sql-vacuum.html</a><br></div></div></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div>______________<br>Atenciosamente<br>Waldirio<br>msn: <a href="mailto:waldirio@gmail.com" target="_blank">waldirio@gmail.com</a><br>Skype: waldirio<br>Site: <a href="http://www.waldirio.com.br" target="_blank">www.waldirio.com.br</a><br>Blog: <a href="http://blog.waldirio.com.br" target="_blank">blog.waldirio.com.br</a></div>
<div>LinkedIn: <a href="http://br.linkedin.com/pub/waldirio-pinheiro/22/b21/646" target="_blank">http://br.linkedin.com/pub/waldirio-pinheiro/22/b21/646</a><br>PGP: <a href="http://www.waldirio.com.br/public.html" target="_blank">www.waldirio.com.br/public.html</a></div></div></div>
<br><div class="gmail_quote">On Thu, May 10, 2018 at 12:54 PM, Dimitri Yioulos <span dir="ltr"><<a href="mailto:dyioulos@netatlantic.com" target="_blank">dyioulos@netatlantic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">







<div link="blue" vlink="purple" lang="EN-US">
<div class="m_-616734047179742803WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Make that decent
</span><span style="font-size:11.0pt;font-family:Wingdings;color:#1f497d"><span>J</span></span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><span> 
</span>.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> <a href="mailto:spacewalk-list-bounces@redhat.com" target="_blank">spacewalk-list-bounces@redhat.<wbr>com</a>
 <<a href="mailto:spacewalk-list-bounces@redhat.com" target="_blank">spacewalk-list-bounces@<wbr>redhat.com</a>> <b>On Behalf Of </b>Dimitri Yioulos<br>
<b>Sent:</b> Thursday, May 10, 2018 3:53 PM</span></p><div><div class="h5"><br>
<b>To:</b> <a href="mailto:spacewalk-list@redhat.com" target="_blank">spacewalk-list@redhat.com</a><br>
<b>Subject:</b> Re: [Spacewalk-list] DIsk usage and limiting number of instances of a package<u></u><u></u></div></div><p></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Maybe a descent programmer (and I’m not that person) could modify the script to do what you ask.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Dimitri<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">
<a href="mailto:spacewalk-list-bounces@redhat.com" target="_blank">spacewalk-list-bounces@redhat.<wbr>com</a> <<a href="mailto:spacewalk-list-bounces@redhat.com" target="_blank">spacewalk-list-bounces@<wbr>redhat.com</a>>
<b>On Behalf Of </b>Matthew Madey<br>
<b>Sent:</b> Thursday, May 10, 2018 3:17 PM<br>
<b>To:</b> <a href="mailto:spacewalk-list@redhat.com" target="_blank">spacewalk-list@redhat.com</a><br>
<b>Subject:</b> Re: [Spacewalk-list] DIsk usage and limiting number of instances of a package<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Is there any way this can be modified to keep "n" number of obsoleted packages? <span style="font-size:10.5pt;font-family:"Segoe UI",sans-serif;color:#24292e;background:white"> I have a scenario where we need to do cleanup on developer
 packages.. they may have for instance 100 versions of a package. We need to keep a certain number of those packages around in case of a rollback scenario, but we want to clean up the rest.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Thu, May 10, 2018 at 12:47 PM, Dimitri Yioulos <<a href="mailto:dyioulos@netatlantic.com" target="_blank">dyioulos@netatlantic.com</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal"><span style="color:#1f497d">Ah, sorry, I see that the script has been updated, and has some problems.  I’ve pasted what I use here: 
<a href="https://pastebin.com/8KuG6J5B" target="_blank">https://pastebin.com/8KuG6J5B</a> .</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"> </span><u></u><u></u></p>
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal">
<b>From:</b> <a href="mailto:spacewalk-list-bounces@redhat.com" target="_blank">spacewalk-list-bounces@redhat.<wbr>com</a> <<a href="mailto:spacewalk-list-bounces@redhat.com" target="_blank">spacewalk-list-bounces@<wbr>redhat.com</a>>
<b>On Behalf Of </b>Dimitri Yioulos<br>
<b>Sent:</b> Thursday, May 10, 2018 1:10 PM<br>
<b>To:</b> <a href="mailto:spacewalk-list@redhat.com" target="_blank">spacewalk-list@redhat.com</a><br>
<b>Subject:</b> Re: [Spacewalk-list] DIsk usage and limiting number of instances of a package<u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">This works well for me: 
<a href="https://github.com/00willo/spacewalk-scripts/blob/master/spacewalk-clean-old-packages.py" target="_blank">
https://github.com/00willo/<wbr>spacewalk-scripts/blob/master/<wbr>spacewalk-clean-old-packages.<wbr>py</a> .  I run it periodically via a cron job.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d">Dimitri</span><u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d"> </span><u></u><u></u></p>
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal">
<b>From:</b> <a href="mailto:spacewalk-list-bounces@redhat.com" target="_blank">spacewalk-list-bounces@redhat.<wbr>com</a> <<a href="mailto:spacewalk-list-bounces@redhat.com" target="_blank">spacewalk-list-bounces@<wbr>redhat.com</a>>
<b>On Behalf Of </b>Mark Prangnell<br>
<b>Sent:</b> Thursday, May 10, 2018 11:57 AM<br>
<b>To:</b> <a href="mailto:spacewalk-list@redhat.com" target="_blank">spacewalk-list@redhat.com</a><br>
<b>Subject:</b> [Spacewalk-list] DIsk usage and limiting number of instances of a package<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><span style="color:#1f497d" lang="EN-GB">H</span><span lang="EN-GB">i,</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">I currently run a spacewalk server (v2.6) that is gradually using up all of its disk space.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">Currently have repositories for:</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">32 and 64bit CentOS 6 (and updates)</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">CentOS 7 (and updates)</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">Dell updates</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">Backup software</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">Also had (but have since removed) EPEL for CentOS 6 and 7 as I suspected these were the guilty party in terms of using up a chunk
 of disk space in the first place.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">Is there any way of limiting the amount of a instances of a specific package that are stored in a repository on spacewalk?</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">Using kernel as an example, we have 21 revisions of it in one repository and probably only need the 5 most recent (if that). Would
 we need to manually remove them or is there some way of telling spacewalk to remove all but the latest 5 revisions of a package and delete the rest?</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">Thanks,</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">Mark</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">##############################<wbr>##############################<wbr>################## This communication together with any attachments
 transmitted with it ("this E-Mail") is intended only for the use of the addressee and may contain information which is privileged and confidential. If the reader of this E-Mail is not the intended recipient or the employee or agent responsible for delivering
 it to the intended recipient you are hereby notified that any use, dissemination, forwarding, printing or copying of this E-Mail is strictly prohibited. Addressees should check this E-mail for viruses. The Company makes no representations as regards the absence
 of viruses in this E-Mail. If you have received this E-Mail in error please notify our IT Service Desk immediately by e-mail at
<a href="mailto:abuse.ttb@talktalkplc.com" target="_blank">abuse.ttb@talktalkplc.com</a> Please then immediately delete, erase or otherwise destroy this E-Mail and any copies of it. Any opinions expressed in this E-Mail are those of the author and do not necessarily
 constitute the views of the Company. Nothing in this E-Mail shall bind the Company in any contract or obligation. For the purposes of this E-Mail "the Company" means TalkTalk Telecom Group PLC and/or any of its subsidiaries. Please feel free to visit our website:
<a href="http://www.talktalkgroup.com" target="_blank">www.talktalkgroup.com</a> TalkTalk Telecom Group Plc (Registered in England & Wales No. 7105891) 11 Evesham Street, London W11 4AR ##############################<wbr>##############################<wbr>##################
</span><u></u><u></u></p>
<p><span lang="EN-GB">##############################<wbr>##############################<wbr>##################<br>
This communication together with any attachments transmitted with it<br>
("this E-Mail") is intended only for the use of the addressee and may contain<br>
information which is privileged and confidential. If the reader of this E-Mail<br>
is not the intended recipient or the employee or agent responsible for<br>
delivering it to the intended recipient you are hereby notified that any use,<br>
dissemination, forwarding, printing or copying of this E-Mail is strictly<br>
prohibited. Addressees should check this E-mail for viruses. The Company makes<br>
no representations as regards the absence of viruses in this E-Mail. If you<br>
have received this E-Mail in error please notify our IT Service Desk<br>
immediately by e-mail at <a href="mailto:abuse.ttb@talktalkplc.com" target="_blank">
abuse.ttb@talktalkplc.com</a> Please then immediately<br>
delete, erase or otherwise destroy this E-Mail and any copies of it.</span><u></u><u></u></p>
<p><span lang="EN-GB">Any opinions expressed in this E-Mail are those of the author and do not<br>
necessarily constitute the views of the Company. Nothing in this E-Mail shall<br>
bind the Company in any contract or obligation.</span><u></u><u></u></p>
<p><span lang="EN-GB">For the purposes of this E-Mail "the Company" means TalkTalk Telecom Group PLC<br>
and/or any of its subsidiaries.</span><u></u><u></u></p>
<p><span lang="EN-GB">Please feel free to visit our website:
<a href="http://www.talktalkgroup.com" target="_blank">www.talktalkgroup.com</a> </span>
<u></u><u></u></p>
<p><span lang="EN-GB">TalkTalk Telecom Group Plc (Registered in England & Wales No. 7105891)<br>
11 Evesham Street, London W11 4AR<br>
##############################<wbr>##############################<wbr>##################</span><u></u><u></u></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><br>
______________________________<wbr>_________________<br>
Spacewalk-list mailing list<br>
<a href="mailto:Spacewalk-list@redhat.com" target="_blank">Spacewalk-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/spacewalk-list" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/spacewalk-<wbr>list</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>

<br>______________________________<wbr>_________________<br>
Spacewalk-list mailing list<br>
<a href="mailto:Spacewalk-list@redhat.com">Spacewalk-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/spacewalk-list" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/spacewalk-<wbr>list</a><br></blockquote></div><br></div>