Unconditional copy

Joined
Oct 16, 2012
Messages
28
Reaction score
0
Points
1
I'm attempting to copy about 20,000+ files from an external Windows (NTSC) hard drive, into my internal Mac drive. The copy process gets underway, reports it will take about 23 hours. About one hour into the copy, a fault is found with a file and the copy process simply stops, no option to continue.

In the Windows world, I can use XCOPY for such a situation, where I want to copy as much as it can without stopping.

On my MacBook (10.6.8), how can I execute an unconditional copy? And unattended, I can't babysit the process for 23 hours.

A Google search for "unconditional copy" for my Mac comes up empty.

Thoughts of others?

Regards,

Terry Smythe
Canada
 

chscag

Well-known member
Staff member
Admin
Joined
Jan 23, 2008
Messages
65,248
Reaction score
1,833
Points
113
Location
Keller, Texas
Your Mac's Specs
2017 27" iMac, 10.5" iPad Pro, iPhone 8, iPhone 11, iPhone 12 Mini, Numerous iPods, Monterey
Your external drive is formatted to "NTFS" not "NTSC" (that's a TV broadcast standard). There may be a way to do it by using the Terminal (command line). Perhaps one of coder experts can come up with a way for you.
 
Joined
Mar 13, 2011
Messages
224
Reaction score
3
Points
18
Your Mac's Specs
2011 MacBook Air, i5 27" IMac, 2010 21.5" IMac, 2010 Mini, 2011 13" MBP, IPhone 4, Airport Extreme
Hi TerrySmythe,

Look up Unison. I believe this will do what you need
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,765
Reaction score
2,106
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
When the external drive is plugged in, it will show up in /Volumes with whatever the name of the drive is. So open up a Terminal window and look at the following commands. You will need to get some information before the commands will do anything, do not type them in blindly
Code:
cd ~/Downloads
mkdir Pictures_Import
cp -aR /Volumes/<name/of/external/drive>/* Pictures_Import

For the command line portion of this you can just use the ~/Documents folder and create a new folder to hold the pictures, as I've done above. Now the "cp" command will recursively copy everything from the external HD to Pictures_Import directory. If there certain sub directories on the external drive that you only care about, then you'll want to add those to the "cp" line.

For example, if the external drive is called "Storage", then the command would be "cp -aR /Volumes/Storage/* Pictures_Import", now if you had a directory on that drive called Pictures, then the command would change to "cp -aR /Volumes/Storage/Pictures/* Pictures_Import"

The * (star, asterisk) after the directory indicates all files..
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
Actually you need to make it *.* just in case.
cp -aR /Volumes/Storage/Pictures/*.* Pictures_Import
Notice the space between *.* and Pictures_Import.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
I suppose this question is for Razor and cradom - would you not want to add -f to force the copy in case of a bad/corrupt file? Would cp terminate if it hit something it couldn't copy or would it just continue?
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,765
Reaction score
2,106
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
The "cp" would only fail if it had a physical error reading the source files. I avoid using "-f" since that would overwrite any local files by force and doesn't actually control continuing one when an issue is encountered. If there is an underlying issue, then "cp" would halt/fail just like the Finder/UI was..
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Gotcha. I've never really had an issue with cp so I wasn't sure.

So, if cp is going to fail like Finder would, how would this solution help?
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
You might want to use ditto as it says it doesn't give up (man ditto).
ditto sourcedir destdir
 
OP
T
Joined
Oct 16, 2012
Messages
28
Reaction score
0
Points
1
Unconditional Copy

Many thanks for the help that has emerged, appreciated. So far, nothing seems to work at all.

* my MacBook 10.6.8
* Source - external NTSF Hard drive
* NTSF's name is "Emachine"
* Target directory - "/Documents and Settings/User/My Documents/*.*

This external hard drive CANNOT be seen/read on my Windows computer, but my MacBook does see it and I can extract random files off it onto a USB thumb drive. My objective is to extract some 20,000+ files (64gigs) from the "My Documents" directory, into my MacBook, so that I can write all those files back out to my main Windows computer, through my home network.

In my MacBook, I've created a new folder "Temp" to receive everything. Trouble is, when using a simple drag/drop, there are a few files that create the following error:

The Finder can’t complete the operation because some data in “TEMPLATE6.pub” can’t be read or written.
(Error code -36)

When that error is encountered, the copy process comes to a complete halt, with no option to continue.

So far, all attempts to use the cp command through Terminal have failed completely, each attempt simply generating the correct syntax I should be using. Not a single file has transferred so far.

I'm hopeful of coming up with a command string that will tell the cp command to pass over an error file and keep going until all is done some 23 hours later, all unattended.

BTW, I'm doing this for a friend.......:)

Regards,

Terry Smythe
Winnipeg, Canada
 
OP
T
Joined
Oct 16, 2012
Messages
28
Reaction score
0
Points
1
Just tried ditto:

ditto /Emachine/Documents and Settings/User/My Documents/* Temp

did not work: can't get real path for source

ditto /Volume/Emachine/Documents and Settings/User/My Documents/* Temp

same error: can't get real path for source

Thoughts of others?

Regards,

Terry Smythe
Winnipeg, Canada
 
Joined
Feb 26, 2010
Messages
2,116
Reaction score
123
Points
63
Location
Rocky Mountain High, Colorado
Your Mac's Specs
1.8 GHz i7 MBA 11" OSX 10.8.2
For *NIX based wild cards *.* is redundant - * will cover everything. Really * is match everything. '.' matches a single "anything" So in old dos days you needed *.* when the . was counted as a separator but you don't need that in modern *nix based systems. When you say *.* you are saying match anything - anyway.
Mac OS X Commands and Wildcard Characters « Mac Apple Tips
(You could see there is an example to pick only files *\.*) but that is an escaped . meaning find only files with dots in them but you don't have to keep that convention.

According to this - the -R should keep copying even with errors
Loading…
So it may be lower level than that.

I had used flow when moving around a large amount of data - seemed to work quite well as it was designed for ftp/sftp but it would move data across local locations too.
Flow — The Mac's Best FTP + SFTP Client
$5 in the appstore - I got it with a bundle so that is why I had it. It worked for me - even with errors but if even cp -R doesn't work then I'm not sure anything will.
 
Joined
Feb 26, 2010
Messages
2,116
Reaction score
123
Points
63
Location
Rocky Mountain High, Colorado
Your Mac's Specs
1.8 GHz i7 MBA 11" OSX 10.8.2
Are you sure you can get to that path? Usually you have to escape spaces with a \

So you would want to do

ditto /Volume/Emachine/Documents\ and\ Settings/User/My\ Documents/* Temp
 
OP
T
Joined
Oct 16, 2012
Messages
28
Reaction score
0
Points
1
Tried ditto:

ditto /Volume/Emachine/Documents\and\Settings/User/My\Documents/* Temp

error: can't get real path for source

ditto /Volume/Emachine/Documents and Settings/User/My Documents/* Temp

error: Can't copy directory /Users/terrysmythe/Microsoft User Data into a file Temp


I'm still trying.

Regards,

Terry Smythe
Winnipeg, Canada
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
ditto /Volume/Emachine/Documents\and\Settings/User/My\Documents/* Temp
You need spaces:
Code:
ditto /Volume/Emachine/Documents\ and\ Settings/User/My\ Documents/* Temp
 
OP
T
Joined
Oct 16, 2012
Messages
28
Reaction score
0
Points
1
unconditional copy

Tried ditto again with spaces:

ditto /Volume/Emachine/Documents\ and\ Settings/User/My\ Documents/* Temp

same error: can't get real path for source

Something strange going on here. I can "walk" the tree of this Windows NTSF external drive, see all the files within, and drag-drop selected files off to an external USB thumb drive. But when I try to do a command through Terminal to cp/ditto all 20,000+ files, the NTSF drive seems to be invisible. I even tried "find" to see if it could see the drive, and all it did was backtrack finding files within my MacBook.

Regards,

Terry
 
Joined
Feb 26, 2010
Messages
2,116
Reaction score
123
Points
63
Location
Rocky Mountain High, Colorado
Your Mac's Specs
1.8 GHz i7 MBA 11" OSX 10.8.2
First it should be /Volumes with an 's'

Second try walking the tree first by using cd - then you can do the ditto command from within the proper directory.
cd /Volumes
cd /Emachine
etc, etc
You can use tab to complete the word. You can use ls to make sure of the directory name. Also even though the file system isn't truly case sensitive - it seems you have to use the proper case when using a Mac Terminal.
Once you get to the proper directory then you can use
ditto * /Temp
 
OP
T
Joined
Oct 16, 2012
Messages
28
Reaction score
0
Points
1
unconditional copy

Many thanks for this tip, appreciated. In Terminal mode:

cd /Volumes works just fine

cd /Emachine fails

ls fails to list the NTSF /Emachine

In Terminal mode, the NTSF /Emachine is invisible.
In graphic mode, the /NTSF /Emachine can be seen and files visible.

What I've now started doing is drag/drop one folder at a time into a series of temporary folders on my MacBook. When a bad file is encountered, I go into that folder, then select all files but that one file, then drag/drop all again. Really slow process, but seems this is the only way to salvage all the files in his /My Documents folder.

It would appear that we have exhausted all possibilities. All the help and advice received this far is appreciated. I suspect that the drive fault that makes it invisible to my Windows computer is contributing to making the drive invisible in Terminal mode. I'll have to live with drag/drop in graphic mode. Strange situation, but painfully slow recovery is doable.

Regards to all,

Terry Smythe
Winnipeg, Canada
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,765
Reaction score
2,106
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
Code:
cd /Volumes
ls -l
Show us the output of this..
 
OP
T
Joined
Oct 16, 2012
Messages
28
Reaction score
0
Points
1
unconditional copy

OK, here is ls - 1 and ls - l Interesting that Terminal can now see the NTSF /Emachine.

Regards,

Terry

Smythe.JPG
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top