A friend of mine said that I could use this pice of code to copy files from one location to another and have it also output an error log
Code:
SOURCEDIR="/Volumes/FreeAgent GoFlex Drive/Anime"
DESTDIR="/Volumes/5TB FreeAgent GoFlex Drive/Anime"
for d in "${SOURCEDIR}/"*; do echo 'copying `basename "${d}"`';cp -r "${d}" "${DESTDIR}/`basename ${d}`" 2> err.log; done
but when I use this code in a .sh file it does the following to the first copied dir, Screen Shot 2016-03-21 at 10.58.01.png it creates the first folder and gives it the label of the drive and the name of the first folder combined.
The original line of code he gave me, that I was going to used before I asked if he could have it output the errors to a log, was
Code:
SOURCEDIR="/Volumes/FreeAgent GoFlex Drive/Anime"
DESTDIR="/Volumes/5TB FreeAgent GoFlex Drive/Anime"
for d in "${SOURCEDIR}/"*; do echo "copying `basename "${d}"`"; cp -r "${d}" "${DESTDIR}"; done
and it worked fine, but now how do I get the error logging pice of code to work?