In my case I am using Western Digital's EasyStore 2TB Hard drive. I found that the drive seems to disconnect when I use it a lot. I think it gets too hot and disconnects to protect the data.
AND - Spotlight was trying like mad to index the drive. So, in the background the hard drive is spinning madly, getting hot, and dis/re-connecting every 30 seconds or so.
So, I turned off Spotlight:
https://www.computerworld.com/artic...ndexing-by-spotlight-for-external-drives.html
AND, I immediately tried to use `rsync` to copy the drive contents to a SanDisk SSD. But, `rsync` was working too hard, causing the drive to disconnect again.
SO: I decided to write my own `rsync.sh` which scanned the WD HD, and copied files, one at a time, and paused for 1 second between file copies. If the drive crashes, the script halts. I can wait for it to come back online and re-run the script. It will pick up where it left off.
This appears to be working. However, I have 750,000 files to copy which means it will take almost 9 days to copy the hard drive to a "safe" location.
I've attached my script here.
NOTE: This is the third Western Digital hard drive that has failed on me. And it is the only one I've been able to safely recover my data from.
LESSON LEARNED: Avoid WESTERN DIGITAL at all costs.
EDIT: I see I left a step off. I don't scan the HD every time I run the script for fear of overworking the drive.
`find "/Volumes/NewGregsDropbox" | cut -c 25-10000 | grep -v '^[.]' > list3.jnk`
Is the command I used to get all the files from the HD and 'cut' off the Volume name and remove 'special' folders.