Re: rm and old rpms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Frank Murphy wrote:
> Hi,
>
> Looking for a method to remove old rpms from a local repo using mtime,
> as *fcX cannot be used in this instance.
>
> It will end up being run as a daily cron job.
>
> Does this look ok?
> find /path/local.repo/*.rpm  -mtime +200 -exec rm {} \;
>

find /path/local.repo -name '*.rpm' -mtime +200 -exec rm {} \;

is OK; when there is many files to remove this maybe faster:

find /path/local.repo -name '*.rpm' -mtime +200|xargs -r rm -f

When /path contains spaces or other "bad" chars (RPM files hasn't them) 
then You should use:

find /path/local.repo -name '*.rpm' -mtime +200 -print0|xargs -r0 rm -f

Franta Hanzlík
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux