bug-ddrescue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-ddrescue] How to do this...?


From: Atom Smasher
Subject: Re: [Bug-ddrescue] How to do this...?
Date: Fri, 20 Jun 2014 21:02:36 +1200 (NZST)

On Fri, 20 Jun 2014, Paul L Daniels wrote:

Basically the hard drives will run for a couple of minutes before shutting down, letting me get about 1~10GB of data off, but I don't want to have to keep manually checking and restarting to reclaim the whole 500GB in this particular case.
============

FWIW, i'm working on a drive right now that can go for hours without a successful read... then it gives me a few sectors before going back to bad sectors and 0b/s data rate.

anyway, based on your request, here's what i'd do...

while :
do
        sha1sum /path/to/log/file > /tmp/log-file-hash
        sleep 300 ## more or less
        sha1sum /path/to/log/file | diff -q - /tmp/log-file-hash
        if [ $? == 0 ]
        then
                ## this code runs if the log file hasn't changed
                ## do something
        fi
done

you may (or may not) want to exclude the "current_pos" line from the logfile. you may want to test to see if the ddrescue process is still running, and hasn't finished. you may also need to re-start ddrescue if the source drive is powered off.

it would be convenient if ddrescue accepted a signal (eg USR1, ALRM) as a way to force it to flush the logfile... but if you wait a few minutes it'll update by itself.


--
        ...atom

 ________________________
 http://atom.smasher.org/
 762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
 -------------------------------------------------

        "All that is necessary for the triumph of evil
         is for good men to do nothing."
                -- Edmund Burke




reply via email to

[Prev in Thread] Current Thread [Next in Thread]