# Create subdirs mkdir -p "$(dirname "$TARGET")"
# Copy with progress bar and error logging if pv "$file" > "$TARGET" 2>/dev/null; then # Verify size SRC_SIZE=$(stat -c%s "$file") DST_SIZE=$(stat -c%s "$TARGET") if [ "$SRC_SIZE" -eq "$DST_SIZE" ]; then echo "OK: $RELATIVE_PATH" >> "$LOG" else echo "FAIL (size mismatch): $RELATIVE_PATH" >> "$LOG" fi else echo "ERROR: $RELATIVE_PATH" >> "$LOG" fi done teracopy linux
rsync -avhc --progress /source/ /destination/ # The -c flag forces checksum comparison, not just timestamp/size. # Create subdirs mkdir -p "$(dirname "$TARGET")" #
echo "=== TeraCopy Style Copy ===" | tee -a "$LOG" TOTAL=$(find "$SOURCE" -type f | wc -l) CURRENT=0 2. Copy with queue and progress find "$SOURCE" -type f -print0 | while IFS= read -r -d '' file; do CURRENT=$((CURRENT + 1)) RELATIVE_PATH="$file#$SOURCE/" TARGET="$DEST/$RELATIVE_PATH" then echo "OK: $RELATIVE_PATH" >