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.

_______________________________________________
Bug-ddrescue mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-ddrescue

Reply via email to