bug-ddrescue
[Top][All Lists]
Advanced

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

Re: [Bug-ddrescue] exit codes


From: Antonio Diaz Diaz
Subject: Re: [Bug-ddrescue] exit codes
Date: Wed, 20 Apr 2011 14:07:47 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905

Hello Thomas,

Thomas Boehm wrote:
I'm trying to find informations about the exit codes ddrescue returns. I couldn't find anything in the docs and after an extensive Google search. It appears that ddrescue always returns 0, no matter whether the user interrupts the process with Control+C or the CD/DVD gets ejected while in progress or ...

I never thought about using the exit code of ddrescue to signal "successful completion" because ddrescue can be told to rescue only part of the failing drive, in which case a "successful completion" results in a logfile with non-tried blocks.

I'll document the exit codes in the next version of the manual, but meanwhile I copy them here as taken from main.cc in the source code:

    Return values: 0 for a normal exit, 1 for environmental problems
    (file not found, invalid flags, I/O errors, etc), 2 to indicate a
    corrupt or invalid input file, 3 for an internal consistency error
    (eg, bug) which caused ddrescue to panic.



I wrote a little script to batch process a pile of CDs/DVDs and want to delete the logfile upon successful completion and keep it if there is a problem or ddrescue gets interrupted.

Or is there another way to delete the logfile upon successful completion?

Currently not, but it can be implemented at least in two ways:

a) Adding an option instructing ddrescue to delete the logfile when all the blocks have been successfuly recovered.

b) Adding an option instructing ddrescuelog to delete a given logfile if all the blocks in that logfile have been successfuly recovered.


I prefer b) because it allows deleting logfiles independently of the rescue process.


Regards,
Antonio.



reply via email to

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