DKeeper


Introduction

DKeeper is simple but useful utility which store information about your files in data media (CD ROMs, floppies, etc.). You can specify a rule for getting information from a particular files (.tgz, .rpm, etc.). Also you can search for a files or export it. DKeeper is capable to export to HTML or MySQL and PHP.

Copying

DKeeper is licensed under the GPL v2.

Rules

Rules

If you want to get information from a particular files (.rpm, .tgz, etc.) you must define a rule for it. Rules are stored in rc file. Example of rc file:

[extensions]
.rpm    : rpm -qi $
.tar.gz : tar tfz $
.tgz    : tar tfz $

The rule's syntax is extension : command. In command the char `$' will be substitute with the name of the file from which are going to get the information.

Rc file

At startup DKeeper is looking for rc file `.dkeeperrc' in home directory. If fails and if the enviroment variable DKEEPER_LIB is set then is looking in this directory. If is not set then is looking in directory seted before compilation (usually /usr/lib/dkeeper).

Modes

Keep mode

You have to use this mode when you want to store the informations from data media to kpr file. The rules found in rc file will be used.

Usage: dkeeper -k -n|a [-l] [-v] label_name start_path kpr_file

You can store more data medias in one kpr file. They will be stored under the unique label name (CD001, CD002). If you are using spaces or other special characters you should enclose the label name with `"' to prevent them to be processed by shell. See section Examples.

start_path is a path where is mounted your data media. For example `/mnt/cdrom' and the kpr_file is the name of kpr file where will be stored the informations. For example `my_cds.kpr'.

If you want to see what file is DKeeper processing use verbose option -v.

Store to new kpr file

You should use this if you are running DKeeper for the first time or if you want to store the informations to a new kpr file. You must use the -n option.

Usage: dkeeper -kn [-l] [-v] label_name start_path kpr_file

If kpr file exists, it will be overwritten.

Store to an existing kpr file

This is a very often used option. You can have more data medias in one kpr file (and is useful to have them). Usage: dkeeper -ka [-l] [-v] label_name start_path kpr_file

Note that the kpr file must exists.

Links

Links in data medias are very dangerous because they can points to an out of media. That's why DKeeper don't follow them but just stores the name of file it points to to an information data of link.

But if you know what are you doing and you want to follow links use -l option.

Search mode

Not written now. See section Examples.

Export mode

Export to html.

Usage: dkeeper -eh html_file|html_dir [-I number] [-D number] kpr_file

Export to the one html file

If your kpr file is small, is useful to export it to the one html file.

Usage: dkeeper -eh html_file kpr_file

Note that pictures are not moved to the dir where is the html_file!! Pictures are in dkeeper's lib directory (usually `/usr/lib/dkeeper/pics').

Export to more html files.

If your kpr file is huge, you should export it to more html files.

Usage: dkeeper -eh html_dir -I number -D number kpr_file

DKeeper will create the directory called `html_dir' and here will be created all html files.

With the -I option you can set how many information data from files will be stored in the one info's html file. If you set it to zero or don't set it at all, all information from files will be stored in the one info's html file.

With -D option you can set how many directories will be stored in the one dir's html file. If you set it to zero or don't set it at all, all directories will be stored in the one dir's html file.

Export to MySQL database and PHP

Usage: dkeeper -em mysql_dir kpr_file

my_sql is directory where will be stored `init.sql'. The PHP scripts are in DKeeper's lib directory (usually `/usr/lib/dkeeper/export/mysql'). The `init.sql' doesn't create database. It's on your shoulders. You must also rewrite mysql_connect in PHP script `index.php3'. I use with PHP the Fast Template which allows you to easy change the HTML look.

Interactive menu

I wrote the shell script which provides interactive menu interface. It can be useful if you hate the command line options (who don't?).

The shell script needs a dialog package. It enables me to write dialogs in shell script. You can download it from Sunsite. It's also in the standart Red Hat distribution.

Examples

Store

dkeeper -knv "CD 001" /mnt/cdrom my_cds.kpr
Store the informations from `/mnt/cdrom' into the kpr file`my_cds.kpr'. If the kpr file exists, then overwrite it (-n). Informations will be stored under the label name CD 001.

dkeeper -kav "CD 002" /mnt/cdrom my_cds.kpr
Let assume that you change the media in your CD-ROM drive. You can add it to exists kpr file (-a) under the label name CD 002 with this command.

Search

dkeeper -s0 "*.rpm" my_cds.kpr
Search for all rpm files in our kpr file. Print the label where are they and their name. Comparing names against file pattern (*.rpm) in not case sensitive. If you want it, use -d option.

dkeeper -s1i mysql "*.rpm" my_cds.kpr
Search for all rpm files with information data containing word mysql. Information data of links will be ignored, because they contains the name of file they points to and we don't care about that. Note that comparing the information data with the info regexp mysql is not case sensitive. If you want it, use -c.

Export

dkeeper -eh my_cds.html my_cds.kpr
Export the kpr file `my_cds.kpr' to the one html file `my_cds.html'. Note that pictures will be not moved to the directory where is html file. You must copy them from DKeeper's lib directory (usually `/usr/lib/dkeeper/pics').

dkeeper -eh my_cds -I 20 -D 20 my_cds.kpr
Export the kpr file `my_cds.kpr' to the more html files. Put them to directory `my_cds'. In one info's html file will be stored 20 information data of files and in one dir's html file will be stored 20 directory contents.

How to contact me

My email: vrabelp@decef.elf.stuba.sk
Home page: http://www.elf.stuba.sk/~vrabelp/dkeeper


This document was generated on 4 March 2000 using texi2html 1.56k.