• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Linux Don't Copy on Error

Circlenaut

Platinum Member
I'm wondering if any one of you know of a way to only copy files that don't produce errors via cp or another command? I'm trying to save files from a RAID array in which a portion of the files became corrupt. When I invoke the cp command it copies everything while the corrupted files throws errors (i.e. input/output errors, bad addresses etc...). I'm wondering if there's a way to exclude the files that throws errors from the destination directory.
 
With my limited knowledge in mind:

Have you tried doing the copy in an if loop and redirecting the error output to null? Not sure if it would work with cp, but it does in other commands: 2>/dev/null (iirc)
 
Back
Top