PDA

View Full Version : dd_rescue multiple files with 'for' syntax in bash



randras_lavos
January 4th, 2011, 08:48 PM
*sorry my english

hello, Ubuntu Forum.. ):P

this is my case,
my sister has a 320GB 3,5" harddisk with bad sectors, windows failed detect it, i've tried almost all of kind- recovery software under windows, and all of those are failed:mad:
So, i installed ubuntu in another harddisk. Lucky me,i have recovered about 82% of all files and directory folders using syntax mix of 'mkisofs','dd', 'dd_rescue' and 'ddrescue' in terminal.
For the rest 18% (bad sector) i'm going to use .sh script in order to get quick result on folders in bad area sector.
so my questions are


Could the 'dd' / 'dd_rescue' / 'ddrescue' handle multiple files in a directory?
I wanna make a .sh script to 'dd_rescue' of some folders in "/mnt/disk320/mydata" and files with extension *.docx, *.xls and *.vob only. In case 'cmd' windows (bat file) like this:

@echo off
title test
for %i in ("d:\mydata\*.docx" "d:\school_data\private\*.xls" "f:\*.vob") do copy %i "c:\backup disk320\"
exit

but replace the 'copy' command with 'dd_rescue' under linux, like this:

#! /bin/bash

for i in $(the kind of files maybe or something ); do
dd_rescue -fwrv -s 10 $i "/mnt/backupDisk/"

syntax above is not finish yet, anyone could help for advanced syntax maybe? (my english is bad, hope you guys understand my post) :-PTHANK U,
Jbu.