Лупайте сю скалу...

Іван Франко

 RSS | Atom

19 June 2015


Selected projects See all »

Banalize: Bash static code analyzerDBIx::Report::ExcelShell settings, AKA dotfilesNagios Monitoring for Couchbase serverNagira: RESTful API for NagiosStartpack for Github pages developmentWeb iPhoto

Travel Blog Витрішки »

Україномовний блог Витрішки - блог про все, крім роботи. Цикл статей "Літо на півночі Японії" з цього блогу тепер опублікований у Витрішках

Computer Blog All posts »

iPhoto and files permission Is MacOSX 10.9 == MacOS 9.x? Running Chef roles from Capistrano und Capiche Github & Jekyll: Speeding up Jekyll siteGithub & Jekyll: More experience with Jekyll and setup changesBuild new hosts with Capistrano and Chef Request Tracker: More about custom CSS for RT4Ruby 2 test drive Nagira v0.2.5 release It's UNIX my dear Watson

Slides See all »

Nagira @TLUG, 2012Rspec and Guard


Ярило Yarylo, Jarilo me @ github me @ CPAN Dmytro (CV)

Package Watcher
Table Of Contents

Linux(UNIX) file changes monitor and tracker

Development environment RedHat Linux (RHEL5)
Ruby (1.9.1/1.9.2)
Author Dmytro Kovalov
Year 2010


Package Watcher is Linux file-system monitoring utility aimed at tracking and saving file changes. It is built as Ruby framework and command line script. Package Watcher uses Ruby library factories for collecting and committing (saving) files change information.


On most modern Linux systems Package Management Systems (PMS) are charged with the task of organizing all of the packages installed on a system including verifying file check-sums to ensure correct and complete packages. Software packages can be easily re-installed on the same or different host from software repository.

Problem arises when server has un-packaged software installed on the host or when files managed by PMS are changed after installation (as for example, many of the configuration files).

To track changes of such files it is not enough to rely on PMS and some other tool should be used. In many cases full system backup is the only tool allowing to keep track of file changes.

Full system backup is usually resource intensive and expensive solution, requiring large amount of storage.

Additionally software repositories already provide reliable source of software packages, and there is no need to store files installed by PMS.

Following information is required to (re)build Linux server:

  • List of software packages (RPM, pkg etc) and versions;
  • Repository of all files managed by PMS, changed since installation;
  • Repository of all files not managed by PMS;

Package Watcher

Package Watcher is a tool filling the gap and providing simple way of identifying files that need tracking outside of PMS and storing files using one of the version control system or by backup tool.

Package Watcher relies on tools available in Linux system to track un-packaged files or files that have changed since installation time and stores all the files needed tracking in version control system.

Package Watcher is built as a set of several Ruby factories making it easy to select particular library depending on the needs. For example, subsystem of tracking server files relies on locate command, but can be changed to use find as well. Tracking packaged files use RedHat? RPM database, but depending on underlying OS, can be changed to use Solaris pkg or Debian style dpkg. Similarly, version control subsystem is built with Subversion support, but any other version control or file backup system can be used instead (git, rsync etc).

Diagram below shows logical diagram of Package Watcher.


Following factories are implemented (or partially implemented) at the time of the writing:

Package::Watcher::Files Factory for constructing list of files on the host. Currently implemented of factory ‘driver’ Package::Watcher::Locatedb , other possible plug-ins can be, for example, Find.
Package::Watcher::Package Factory for constructing list of files belonging to packages installed on the host and list of files that are changed since installation time. Currently implemented Package::Watcher::Rpm , others can be Pkg or Deb, for example.
Exclusion factory handles list of files to be excluded from commits. Configurable option relies on configuration file (by default ./etc/warden.yml). See CONFIGURATION for details.
Package::Watcher::VC Version Control factory. Currently implemented Subversion plug-in: Package::Watcher::Svn , possible candidates: Package::Watcher::Git , Package::Watcher::Rsync , etc.

Factory Modules Relationship Diagram


Dmytro Kovalov

Tokyo, 2010, Dec

дмитро ковальов
dmytro @ github