<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 20 April 2015 at 07:26, Jerry <span dir="ltr"><<a href="mailto:mythtv@hambone.e4ward.com" target="_blank">mythtv@hambone.e4ward.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><p dir="ltr"><br>
On Apr 17, 2015 6:51 AM, "Stephen Worthington" <<a href="mailto:stephen_agent@jsw.gen.nz" target="_blank">stephen_agent@jsw.gen.nz</a>> wrote:<br>
><br>
><br>
> few bad sectors. For recording partitions, I recommend using a script<br>
> that runs ddrescue on each file individually in turn, something like<br>
> this:<br>
><br>
> #!/bin/bash<br>
><br>
> source=/mnt/bad/recordings<br>
> dest=/mnt/new/recordings<br>
> cd $source<br>
> for a in * ; do<br>
> #echo $a<br>
> ddrescue -v "$source/$a" "$dest/$a" "$dest/$a.log"<br>
> done</p>
<p dir="ltr">Would the following script work? I would like to grab all of the recoverable files at once. Or should "-name *" be "-type f" to skip the directories? I may have mangled the paths.</p>
<p dir="ltr">#!/bin/bash</p>
<p dir="ltr">source=/mnt/bad<br>
dest=/mnt/new<br>
cd $source<br>
find . -name * | while read a; do<br>
echo $a<br>
ddrescue -v "$source/$a" "$dest/$a" "$dest/$a.log"<br>
done</p>
<p dir="ltr"><br></p></blockquote></div></div><div class="gmail_extra">You may well get wildcard issues using a "raw" * in a find command.<div><br></div><div>better to use:<br><br></div><div> find . -name '*'</div><div><br></div><div>Even better, ditch the -name part entirely, since find will return all entries anyway by default!</div><div><br></div><div>You may want to include</div><div> -type f</div><div><br></div><div>to only match files (skipping directories etc.)</div><div class="gmail_extra"><br></div></div></div>