1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2024-11-25 00:53:43 +00:00
dindexer/README.md

88 lines
3.6 KiB
Markdown
Raw Normal View History

2015-12-04 18:54:16 +00:00
# dindexer #
2015-12-08 16:41:07 +00:00
## Flattr ##
[![Flattr this git repo](http://api.flattr.com/button/flattr-badge-large.png)](https://flattr.com/submit/auto?user_id=King_DuckZ&url=https%3A%2F%2Fbitbucket.org%2FKing_DuckZ%2Fdindexer&title=dindexer&language=c%2B%2B&tags=bitbucket&category=software)
Please support the development of this software if you like it!
2015-12-04 18:54:16 +00:00
## Debug build status ##
[![Build Status](https://drone.io/bitbucket.org/King_DuckZ/dindexer/status.png)](https://drone.io/bitbucket.org/King_DuckZ/dindexer/latest)
2015-12-04 18:56:55 +00:00
## What is dindexer? ##
2015-11-13 16:58:51 +00:00
dindexer (from "Disc Indexer") is a program to help you keep track of where your files are as you back them up on external media. It's like updatedb/locate, but it's thought for never changing removable media, such as DVDs and BluRays.
Running dindexer on your disks will build a list of all your files and directories. You can associate those lists to a descriptive name and a number, so it's easy to find on what disk a file is on the next time you search for that file.
dindexer will also help you keeping track of duplicate data.
2015-12-04 18:56:55 +00:00
### Configuration ###
2015-11-13 16:58:51 +00:00
As dindexer needs to write data to a PostgreSQL database, you need to configure access to it. Create a ~/.config/dindexer.yml file with the settings to connect to your database. For example:
%YAML 1.2
---
db_settings:
username: bob_db
password: my_secret_db_password
dbname: dindexerdb
port: 5432
address: 127.0.0.1
2015-12-04 18:56:55 +00:00
### Usage ###
2015-11-13 16:58:51 +00:00
Using dindexer is pretty straightforward: mount your DVD and scan it. For example:
mount /dev/cdrom /media/my_backup
dindexer --setname "My generic backup 2015-11-13" /media/my_backup
2015-11-13 17:11:32 +00:00
The program will go through every file in the path you specify. Hashing everything in that path could take a bit of time, so please be patient.
2015-11-13 16:58:51 +00:00
You can run dindexer --help to see a list of available switches.
2015-12-04 18:56:55 +00:00
## Build instructions ##
### Dependencies ###
2015-11-13 19:25:32 +00:00
The following libraries must be available on your system:
- PostgreSQL (libpq)
- Boost 1.53 or later
- yaml-cpp 0.5.1 or later
2015-12-08 16:44:26 +00:00
- libblkid (from util-linux/misc-utils) *optional, build with -DDINDEXER_WITH_MEDIA_AUTODETECT=Off if you don't have this*
2015-11-13 19:25:32 +00:00
2015-12-04 18:56:55 +00:00
### Linux ###
2015-11-13 16:58:51 +00:00
mkdir dindexer_build
cd dindexer_build
cmake -DCMAKE_BUILD_TYPE=Release <path to dindexer source>
make -j2
2015-12-04 18:56:55 +00:00
### Other platforms ###
I never tested dindexer on anything other than Linux. Note that the code assumes paths to be Unix-like. It also makes other assumptions about the current platform being Linux, so porting could be not so straightforward.
2015-11-13 16:58:51 +00:00
## Project status ##
2015-11-13 17:11:32 +00:00
This project is at an early stage and is still being developed. Currently, only the indexer has been implemented. You can search the database manually if you know how to write the SQL queries you will need.
2015-12-04 18:56:55 +00:00
## Useful technical details ##
### Queries ###
2015-11-13 17:11:32 +00:00
2015-12-04 18:56:55 +00:00
#### Find duplicates ####
2015-11-13 17:11:32 +00:00
List all duplicate files belonging to different sets:
select files.hash, group_id, t.ct from files
inner join (
select hash, count(*) as ct from files group by hash having count(distinct group_id) > 1
) t
on t.hash = files.hash
group by files.hash, group_id, t.ct order by files.hash;
### Set number ###
2015-11-13 17:11:32 +00:00
In the sets table you can find a disk_number column that is currently not used. This is in case you have numbered discs, so you are free to put any number you like in that column.
### Disc type ###
For your convenience, you can store the type of the disc you are going to index. Currently this has no impact on the program's behaviour. Available types are:
* **C** - CD-Rom
* **D** - Directory
* **V** - DVD
* **B** - BluRay
* **F** - Floppy Disk
* **H** - Hard Disk
* **Z** - Iomega Zip
* **O** - Other