I have a home directory in a disk that has a lot of corrupted files. I am trying to save most files as possible. I am trying to create a backup of my home directory on an external drive usingtar -cvf backup /home/myHomeand also have triedrsync -vfh /home/myHome /media/backupBoth methods stop when they found a corrupt file. Is there a way to force one or the other to continue copying and ignore bad files, copying everything that is possible to copy and show me a log at the end of the files that were not copied?Thanks.
force copying a corrupted home directory
backup;rsync;tar;home
I wrote a little script for that#!/bin/bashecho copying from $1find $1 -type f -print0 | while read -d $'\0' -r file ; do    echo Processing $file    target=$2$file    if (test -f $target) then        echo File Exists:  $target    else        echo copying to $target        targetDir=`dirname $target`        if (! [ -d $targetDir ]) then            mkdir $targetDir        fi        ddrescue -e0 -r0 -v -n $file $target        if ([ $? -ne 0 ]) then            echo Copy failed, deleting $target            rm -f $target        fi    fidone