Giter VIP home page Giter VIP logo

photorec-directory-beautifier's Introduction

photorec directory beautifier

Photorec directory beautifier

Why this tool was created

I had a crashed hard disk and was forced to recover data because many photos and movies were contained without any backup.

My steps to recover my data:

  • Having no longer any access to hard drive I thought the PCB controller could be the problem

  • So I bought a second hand hard disk having same hardware specification as my crashed device

  • Replaced defect PCB controller

  • Booted with a LIVE Linux CD โ€ฆโ€‹

  • Was able to access my hard drive again - but with errors and no file system

  • Started a full dump / restore of my hard disk with ddrescue:
    ddrescue /dev/sdb ./full-sdb-backup.img ./full-sdb-rescue.log

  • After some time even the "new" PCB controller crashed, but at least an image was available with some data.

  • I used photorec, which is part of testdisk suite, to restore photos from former created image.
    (Simply call photorec on command line)

I was able to recover a big amount of data - not all, but most data. Thanx a lot to all people involved developing formerly mentioned tools!

Unfortunetely the resulting file structure contains all recovered files in a random structure and also random file names. Only the modification time stamp was recovered as well:

photoRecOutputDir/
  recup_dir.1/
         f0225128.jpg
         f0236000.jpg
         f0321233.doc
         f0423351.exe
         ...etc.
  recup_dir.2/
  	     ...etc.
  recup_dir.63
         ...etc.

I was only interested in some specific files - mostly in JPEG. Also sorting all these files manually (>60.000 files) was no option. So I wrote this software.

License

To keep this simple this software is MIT license.

Build

Just execute ./gradlew fatJar

This will build pdb.jar inside build/libs which contains all dependencies.

Usage

java -jar pdb.jar -s ${photoRecOutputDir} -t ${pdbTargetDir}

Output structure

It simply tries to get origin creation time from files (JPEG meta information). If not possible the "last modified" file time stamp is used as a fallback. It also makes top level sub directories which have upppercased filending name, so garbage can be easily destroyed by a folder delete.

File names are in format yyyy-MM-dd_HH-mm-ss with origin file name ending.

Here an example output:

pdbTargetDir/
        JPEG/
           2019/
               01/
                 2019-01-01_13-12-01.jpg
                 2019-01-11_14-03-21.jpg
                 ...etc..
               12/
                 2019-12-01_13-12-01.jpg
                 2019-12-01_13-13-21.jpg
                 ...etc...

           2020/
               ...etc...

        EXE/
           2008/
                05/
                  2008-05-01_23-12-10.exe
                  ..etc..
                ..etc..
           ..etc..
        DOC
           ..etc..
        ...etc..

photorec-directory-beautifier's People

Contributors

de-jcup avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.