rpmusage.pl

NAME

rpmusage - display rpm packages last use

DESCRIPTION

rpmusage will display for each package, the last date it was used (in days). It can be used to find unused packages. It use the atime field of all package's files to do this job. Note : as it scan all files inodes, the run may be long ...

SYNOPSIS

rpmusage.pl [options] [targets]

options:

   -help                brief help message
   -man                 full documentation
   -V, --version        print version

   -verbose             verbose
   -fullalgo            force full algorythm
   -use-cache           use cache to avoid rpm query
   -clear-cache         remove cache file

   -exclude pac         exclude pac from results
   -install-time +/-d   apply on packages which are installed before (after) d days
   -access-time d       apply on packages which are not been accessed for d days (slow)

targets:

   -package pac         search last access on pac package
   -all                 apply on all packages (this is the default)
   -guess-perl          apply on perl packages
   -guess-python        apply on python packages
   -guess-pike          apply on pike packages
   -guess-ruby          apply on ruby packages
   -guess-common        apply on common packages
   -guess-data          apply on data packages
   -guess-doc           apply on documentation packages
   -guess-dev           apply on development packages
   -guess-lib           apply on library packages
   -guess-all           apply all -guess-* options (perl, python ...)
   -guess-custom regex  apply the given regex to filter to package's names to filter the output

REQUIRED ARGUMENTS

it can be used without any argument, and then will apply on all packages

OPTIONS

-help

Print a brief help message and exits.

-man

Print the manual page and exits.

-version

Print the program release and exit.

-verbose

The program works and print debugging messages.

-use-cache

the rpm query may be long (10 to 30 s). If you will run an rpmorphan tool several time, this option will allow to gain a lot of time : it save the rpm query on a file cache (first call), then use this cache instead quering rpm (others calls).

-clear-cache

to remove cache file. Can be used with -use-cache to write a new cache.

-exclude

this option will specify the packages to exclude from the output. Can be used as '--exclude pac1 --exclude pac2' or '--exclude "pac1, pac2"'

-install-time

install-time is a filter on the period from the package installation date to now (in days). if set positive, it only allow packages installed before x days. if set negative, it only allow packages installed since x days.

-access-time

access-time is designed to filter packages which have not been used since x days.

be careful : this option will slow the program

-fullalgo

for a small list of packages, rpmusage use a different quicker methode : rpm -e --test

this option can be used to force the use of the full algo

-package

search if the given package(s) is(are) orphaned. Can be used as '--package pac1 --package pac2' or '--package "pac1, pac2"'

-all

apply on all installed packages. The output should be interpreted. For example lilo or grub are orphaned packages, but are necessary to boot ...

the "-install-time" and "-access-time" options may be useful to filter the list

-guess-perl

This option tries to find perl modules. It tries to match "^perl"

-guess-python

This option tries to find python modules. It tries to match "^python"

-guess-pike

This option tries to find pike modules. It tries to match "^pike"

-guess-ruby

This option tries to find ruby modules. It tries to match "^ruby"

-guess-common

This option tries to find common packages. It tries to match "-common$"

-guess-data

This option tries to find data packages. It tries to match "-data$"

-guess-doc

This option tries to find documentation packages. It tries to match "-doc$"

-guess-data

This option tries to find data packages. It tries to match "-data$"

-guess-dev

This option tries to find development packages. It tries to match "-devel$"

-guess-lib

This option tries to find library packages. It tries to match "^lib"

-guess-all

This is a short to tell : Try all of the above (perl, python ...)

-guess-custom

this will allow you to specify your own filter. for exemple "^wh" will match whois, whatsnewfm ...

USAGE

display all packages in access date order

rpmusage.pl --all | sort -k 2 -n

only ask for perl packages

rpmusage.pl --guess-perl | sort -k 2 -n

to read the output : "python-pexpect 97 on /usr/share/doc/python-pexpect" means the package was last used 97 days ago and the more recently used file was the /usr/share/doc/python-pexpect file

FILES

/tmp/rpmorphan.cache : cache file to store rpm query. The cache file is common to all rpmorphan tools

DEPENDENCIES

rpmusage uses only standard perl module.

but it needs the rpm command tool.

BUGS AND LIMITATIONS

the software can only work with one version of each software : we only treat the first version seen

CONFIGURATION

the program can read rcfile if some exists. it will load in order

/etc/rpmorphanrc

~/.rpmorphanrc

.rpmorphanrc

In this file,

# are comments,

and parameters are stored in the following format : parameter = value

example :

all = 1

curses = 1

INCOMPATIBILITIES

not known

DIAGNOSTICS

to be written

NOTES

this program should be used as root superuser, because it needs to access (in read mode) to all files

SEE ALSO

rpmorphan(1)

rpmdep(1)

rpmduplicates(1)

rpmextra(1)

EXIT STATUS

should be allways 0

LICENSE AND COPYRIGHT

Copyright (C) 2006 by Eric Gerbier This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

AUTHOR

Eric Gerbier

you can report any bug or suggest to gerbier@users.sourceforge.net

 rpmusage.pl