NAME

rpmrestore.pl - restore attributes from rpm database

DESCRIPTION

The rpm database store user, group, time, mode for all files, and offer a command (rpm -V ) to display a summary of the changes between install state (database) and current disk state. Rpmrestore can display detailed changes and can restore install attributes.

SYNOPSIS

rpmrestore.pl [options] [ target ]

target:

   file|package         file or package
   -package package     (deprecated) apply on designed package
   -file filename       (deprecated) apply on designed file

options:

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

   -verbose             verbose
   -batch               batch mode (ask no questions)
   -n, --dry-run        do not perform any change
   -log logfile         log action in logfile
   -rollback logfile    restore attributes from logfile (written by -log)

  -all          apply on all attributes
  -user         apply on user
  -group        apply on group
  -mode         apply on mode
  -time         apply on mtime
  -size         apply on size (just display)
  -md5          apply on md5 (just display)
  -capability   apply on capabilities

REQUIRED ARGUMENTS

you should provide a target, to work on

this can be

-package

The program works on designed installed rpm package.

-file

The program works on designed file, which should be a part from a rpm package.

-rollback

The program works from designed log file, and rollback (revert) the changes.

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.

-batch

The program works without interactive questions (the default mode is interactive)

-dryrun

The program just show the changes but not perform any restore

-log

The program write the changes in designed log file. This file can be used for rollback.

-package

(deprecated) The program works on designed installed rpm package.

-file

(deprecated) The program works on designed file, which should be a part from a rpm package.

-rollback

The program works from designed log file, and rollback (revert) the changes.

-all

If no attribute are specified, the program work on all, as if this flag is set. It is the same as : -user -group -mode -time -size -md5

-user

This is the owner attribute

-group

This is the group attribute

-mode

This is the file permissions : read-write-execute for user, group, other

-time

This attribute is the date of last changes on file.

-size

This is the file size attribute. This is a "read-only" attribute : it can not be restored by the program.

-md5

md5 is a checksum (a kind of fingerprint) : if the file content is changed, the checksum will change too. A difference on this attribute means the file content was changed. This is a "read-only" attribute : it can not be restored by the program.

-capability

capability means for posix capability. This is not available on all linux distributions. You can look getcap/setcap man pages for more informations.

USAGE

the rpm command to control changes on rpm package

  rpm -V rpm

same effect (just display) but more detailed (display values)

  rpmrestore.pl -n rpm

interactive change mode, only on time attribute

  rpmrestore.pl -time rpm

interactive change mode, on all attributes except time attribute

  rpmrestore.pl -all -notime rpm

batch change mode (DANGEROUS) on mode attribute with log file

  rpmrestore.pl -batch -log /tmp/log rpm

interactive change of mode attribute on file /etc/motd

  rpmrestore.pl -mode /etc/motd

interactive rollback from /tmp/log

  rpmrestore.pl -rollback /tmp/log

batch rollback user changes from /tmp/log

  rpmrestore.pl -batch -user -rollback /tmp/log

CONFIGURATION

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

/etc/rpmrestorerc

~/.rpmrestorerc

.rpmrestorerc

In this file,

# are comments,

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

example :

verbose = 0

dry-run = 1

batch = 0

NOTES

you should be superuser to restore attributes, other users can only check changes

on batch mode, we recommend to use log file

DIAGNOSTICS

(to be filled)

EXIT STATUS

the program should allways exit with code 0

DEPENDENCIES

this program uses "standard" perl modules (distributed with perl core) : POSIX Digest::MD5 English Getopt::Long Pod::Usage POSIX Digest::MD5 File::stat Data::Dumper

INCOMPATIBILITIES

none is known

BUGS AND LIMITATIONS

this program can revert changes on user, group, time, properties, but not on size and md5 : it can only show the differences

SEE ALSO

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