I've decided to go through the same process with all the other drives I have kicking about. I've accumulated about 25 over the years!
Some are pretty big so I've added to the script so that instead of dumping all the files into one folder they are separated by file type... ie /jpg, /png, /rar etc
The downside is that I have to return to the computer, change "filetype=***" and restart the script. I don't mind restarting it for each drive but it's quite repetitive doing it for each file type on each drive!
Is there a way to change what I've done so far so that "filetype=***" is changed for each filetype in /data until everything has been sorted and /data is deleted?
A bit like... "for i in /data, filetype=i"
Code:
filetype=png
&& original=data
&& new=flat
&& mkdir -p /$new/$filetype/
&& find /$original -name "*.$filetype" -type f -exec cp -v {} /$new/$filetype \;
&& sudo find /$original -name "*.$filetype" -type f -exec rm -v {} \;
&& find /$original -empty -type d -delete
Thank you!