Don't copy the folder, only copy the contents:
## Create the target directory. The -p suppresses error messages ## if the directory already exists mkdir -p outputFolder ## Copy the contents recursively, this will not recreate the parent cp -R inputfolder/* outputfolder/ This way you both ensure that the target dir is created the first time the script runs and avoid the issue when running it a second time.
Both -p for mkdir and -R for cp are defined by POSIX so this should be perfectly portable.