manpagez: man pages & more
info ddrescue
Home | html | info | man

File: ddrescue.info,  Node: Command mode,  Next: Fill mode,  Prev: Direct disc access,  Up: Top

12 Copying parts of the input file on demand
********************************************

The command mode of ddrescue implements a scripting interface similar to
the one of ed. *Note ed manual: (ed)Top. In this mode commands are read
from the standard input and executed to copy parts of the input file to the
output file, retrieve information from the mapfile, or write the mapfile to
disc. Ddrescue's responses are written to standard output. "done\n" for a
successfully executed command, "error\n" for a failed command (for example
because of wrong arguments), and "error: ERROR MESSAGE\n" for serious or
fatal errors like write errors.

   If end-of-file is detected on standard input, ddrescue discards any
partial command being read and executes the 'f' (finish) command.

   All ddrescue commands are single characters, though some require
additonal parameters separated by spaces. Only one command is allowed per
line. Ddrescue recognizes the following commands:

'c POS SIZE'
     Copy command. Copies a block of data from INFILE to OUTFILE and
     updates the internal copy of the mapfile. The areas already marked as
     finished in the mapfile are not copied again.

'f'
     Finish command. Compacts the internal copy of the mapfile and writes
     it to MAPFILE (if it was specified in the command line). Then prints
     "done\n" to standard output and quits. On startup, the mapfile is first
     compacted and then split following the rescue domain borders. The
     finish command compacts the mapfile again before exiting. If writing
     MAPFILE to disc fails, a non-interactive emergency save is tried
     before exiting. *Note Emergency save::.

'q'
     Quit command. Exits ddrescue. Does not update the mapfile.

's POS SIZE'
     Status command. Writes to standard output one or more lines in mapfile
     format (*note Mapfile structure::), showing the status of the areas
     included in the block requested. A line consisting of the string
     "done" marks the end of the list.

'u'
     Update mapfile command. Writes the internal copy of the mapfile to
     MAPFILE (if it was specified in the command line). If update mapfile
     fails, you may try to fix the problem, for example deleting some files
     to make room for MAPFILE, before trying to update it again.


© manpagez.com 2000-2025
Individual documents may contain additional copyright information.