All pastes #136583 Raw Edit

Mine

public text v1 · immutable
#136583 ·published 2006-08-17 19:45 UTC
rendered paste body
#!/bin/bash
# pcp - Prompt Copy
# copy a directroy of files to a destination, prompt to continue or abort if errors are encountered.
# Copyright (c) Humanity

destination=eval final_dest=\$$#

while (( $# > 1 )); do
  source="$1"; shift
  find $source -type f | while read file; do
    while (true); do
      echo cp --preserve=all --no-dereference --parents "$file" "$destination";

       #make sure it copied without error
       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;
  done;
done;

echo 'complete';
exit;