rpmrestore.pl - restore attributes from rpm database |
rpmrestore.pl - restore attributes from rpm database
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.
rpmrestore.pl [options] [ target ]
target:
file|package file or package
-package package (old syntax) apply on designed package
-file filename (old syntax) 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)
-digest apply on digest (just display)
-capability apply on capabilities
you should provide a target, to work on
this can be
The program works on designed installed rpm package.
The program works on designed file, which should be a part from a rpm package.
The program works from designed log file, and rollback (revert) the changes.
Print a brief help message and exits.
Print the manual page and exits.
Print the program release and exit.
The program works and print debugging messages.
The program works without interactive questions (the default mode is interactive)
The program just show the changes but not perform any restore
The program write the changes in designed log file. This file can be used for rollback.
(old syntax) The program works on designed installed rpm package.
(old syntax) The program works on designed file, which should be a part from a rpm package.
The program works from designed log file, and rollback (revert) the changes.
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 -digest
This is the owner attribute
This is the group attribute
This is the file permissions : read-write-execute for user, group, other
This attribute is the date of last changes on file.
This is the file size attribute. This is a "read-only" attribute : it can not be restored by the program.
digest 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 means for posix capability. This is not available on all linux distributions. You can look getcap/setcap man pages for more informations.
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
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
you should be superuser to restore attributes, other users can only check changes
on batch mode, we recommend to use log file
(to be filled)
the program should allways exit with code 0
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
none is known
this program can revert changes on user, group, time, properties, but not on size and digest : it can only show the differences
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.
Eric Gerbier
you can report any bug or suggest to eric.gerbier@tutanota.com
rpmrestore.pl - restore attributes from rpm database |