Re: Empty directories no content for >= 6mths

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

 



On Thu, Feb 13, 2014 at 13:36:49 +0000,
  Frank Murphy <frankly3d@xxxxxxxxx> wrote:
On Thu, 13 Feb 2014 07:16:37 -0600
Bruno Wolff III <bruno@xxxxxxxx> wrote:

You coukd check which ones are owned by packages. rpm -qf will show
the package that owns a file or directory. You probably don't want to
delete those.

So I could run this every 6 month .
find ~/ -mtime 180 -type d -empty > empty.list \
&& rpm -qf $(cat empty.list)

To automate it you'd need to tweak the script. rpm -qf will tell you the package(s) that own the directories or warning messages for those that aren't owned. I don't know that it returns a status, so you'd probably want to pipe the output through grep and check its status. And you'd need to do this one file at a time.

Also note that using cat on a command line isn't going to work well for file names that have spaces in them. You'd probably want to use find's -exec test to run the final test script as that can hand off file names without having them parsed by the shell.
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org




[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux