#!/bin/bash find $1 -type f | while read file { while (1); do # keep copying trying to copy this file till it works! { echo cp -R --preserve=all --no-dereference --parents "$file" "$2" #make sure it copied fine if [ $? -ne 0 ]; then { echo 'An error has occured, perhaps the medium is full. Press enter to continue, or CTRL+c to quit'; read }else{ break } fi } done; } echo 'complete' exit