A non-recursive approach to using ddrescue
on a directory.
Chances are, if you have a currupted set of memory, it's not just a few files. It's probably a whole disk.
Wanna save it? You can use ddrescue
, but that doesn't work on directories, only files. If you want to use
it on a whole big directory, you'll need to do each file one by one. That's exactly what this script does.
$ fish ddrfind.fish
It can work with both relative and absolute paths. Though better use absolute paths and not work on the dying drive.
The
cd
in line 11 into the source path is a bummer for bad disks that disconnect every time ddrescue touches a bad block. So I rewrote my fork yesterday to keep the working directory as it is. It does some other nice things too, like preserving metadata, and retry files that differ in size on consecutive runs.