Re: Recursively Copy Files, ignoring I/O Errors
Re: Recursively Copy Files, ignoring I/O Errors
- Subject: Re: Recursively Copy Files, ignoring I/O Errors
- From: Graff <email@hidden>
- Date: Sat, 05 Jun 2004 23:32:45 -0400
I believe that the "ditto" shell tool will copy all files by default.
If it encounters an error it should just send a message to stderr (the
standard error output) about the bad file and then continue with the
rest of the files. You should be able to just do this in the Terminal:
ditto --rsrc "/path/on/bad/drive" "/path/on/good/drive"
For example, if the good drive is the boot drive, the save folder is a
folder named "Save" on the current user's desktop, the bad drive is
named "Foo" and the user account on the bad drive was "Bar" then this
would be the command:
ditto --rsrc "/Volumes/Foo/Users/Bar" "~/Desktop/Save"
Make sure what name the bad volume was mounted under. If you have two
volumes that both have the name "Macintosh HD" one will get mounted as
"Macintosh HD" and the other as "Macintosh HD-1". To check this go
into the terminal and type:
ls -l /Volumes
If you see two names such as "Macintosh HD" and "Macintosh HD-1" then
you need to do some poking around to make sure which is which. If one
of the "Macintosh HD" drives is the boot volume then it should look
like this when you list it with the command above:
lrwxr-xr-x 1 root admin 1 5 Jun 16:41 Macintosh HD -> /
drwx------ 10 someuser unknown 340 7 Mar 07:29 Macintosh HD-1
The one with "-> /" after it is the boot volume. Since you should be
booting from the undamaged volume that means that the damaged one is
the other one ("Macintosh HD-1")
- Ken
On Jun 5, 2004, at 3:38 PM, Marconi wrote:
My daughter's iMac has suffered massive HD damage, tens of thousands
of bad sectors. Neither Drive 10 nor TechTool pro 4 can repair
anything. The damage is so bad that when I click the directory
"Desktop" in her home directory while in column view, Finder quits and
restarts.
At this point, I'd just like to copy anything that is not damaged from
her drive to a new volume. Unfortunately, If I try to copy even
several files at a time, if even one I/O error occurs, Finder aborts
the entire copy operation. Worse, it leave lots of incomplete, "in
use" files in the destination.
This means that I can either copy tens of thousands of files, one at a
time in Finder, or try to script a way to recursively copy whatever is
copyable and ignore all I/O errors. I've searched VersionTracker for
something suitable and come up empty. So...
I'd like to be able to simply designate her current (damaged) user
home directory as the source, designate a destination on another
volume, and have a script copy everything therein, recursively, that
doesn't result in an I/O error. If a file does result in an I/O error,
ignore it and more on.
Anyone have a script to do this?
Is a Unix-y script better? Anyone have an idea how to copy (including
resource forks, where present) in terminal, recursively, ignoring
files that cannot be read?
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.