Is there a way to prevent my Mac from sleeping during a file copy?
caffeinate rsync
Consider using the command line tool rsync to safely copy large amounts of data on your Mac. Prefix the command with caffeinate to keep your Mac awake during the copy.
The Terminal.app command will look something like:
 sudo caffeinate rsync -vaE --progress /Volumes/SourceName /Volumes/DestinationName

rsync has the benefit of being able to resume failed or interrupted copies.
If the copy has already begun, run caffeinate with the flag -t &lt;seconds&gt; for a specific duration or -w &lt;pid&gt; for the life time of a specific process.