I have written an applescript to rename files in the destination folder to avoid name collistions. It does not rename files in an imbedded folder from the source folder. It renames only files and folders in the first level of the source folder when they are copied to the destination folder.
Please test this script before usng in prouction. It did work once before I uploaded it! Gaurenteed to have been tested once!
Let me know if you need files in subfolders renamed too! Maybe I could work on this.
It's a applescript:
(*
Author: rccharles
For testing, run in the Script Editor.
Click on the Event Log tab to see the output from the log statement
Click on Run
debug...
rsync -av --dry-run source/ target
*)
on run
-- Write a message into the event log.
log " --- Starting on " & ((current date) as string) & " --- "
set theFolder to choose folder with prompt "Source folder. Files will be renamed as needed"
--set theFolder to (get "Macintosh-HD:Users:mac:config:") as alias
log " theFolder = " & theFolder
set posixPath to POSIX path of theFolder
-- Names of the folders to backup. Use Unix names path.
tell application "System Events"
set sourceList to POSIX path of every file in folder posixPath
end tell
set my text item delimiters to ", "
-- Volume to back up to.
set targetVolume to choose folder with prompt "Destination folder. Files will be renamed as needed"
log "targetVolume = " & targetVolume
set posixTargetVolume to POSIX path of targetVolume
log "posixTargetVolume = " & posixTargetVolume
repeat with theFile in sourceList
set passedFile to theFile as string
log "passedFile = " & passedFile
set quotedPassedFile to quoted form of passedFile
set theBaseName to do shell script "basename " & quotedPassedFile
log "theBaseName= " & theBaseName
-- Check if folder or file already exits
set combinedName to posixTargetVolume & "/" & theBaseName
log "combinedName = " & combinedName
set passCombinedName to combinedName
set theEnd to 99
repeat with i from 1 to theEnd
set newP to POSIX file passCombinedName as string
log "newP = " & newP
tell application "Finder"
set existFileorFolder to exists file newP
end tell
log "existFileOrFolder = " & existFileorFolder & " passCombinedName = " & passCombinedName
if existFileorFolder is true then
set passCombinedName to combinedName & "-" & i
else
exit repeat
end if
end repeat
log "i = " & i
if i ≥ theEnd then
-- create a save name based on time.
delay 1 -- make sure we do not use the same time.
set passCombinedName to combinedName & ((current date) as string)
end if
log " passCombinedName = " & passCombinedName
set passCombinedName to quoted form of passCombinedName
log "passCombinedName = " & passCombinedName
set quotedPassedFile to quoted form of passedFile
-- Make the actual copy.
set see to "ditto -X -rsrc " & quotedPassedFile & " " & passCombinedName
log "see= " & see
try
with timeout of 40 * 60 seconds
set results to do shell script see
end timeout
on error errorMsg
display dialog "error-2 " & errorMsg & " results for …" & return & see
end try
(*
on error errorMsg
display dialog "error-3 " & errorMsg & " results for " & theFile
end try
*)
end repeat
end run
-- ------------------------------------
The first thing that you need to do is to make the text into an AppleScript program.
Start the AppleScript Editor
/Applications/AppleScript/Script Editor.app
In Snow Leopard it's at: /Applications/Utilities/AppleScript Editor
Copy the script text to the Applescript editor.
Save the text to a file as an application and do not check any of the boxes below.

If you want access to the script from your Script Menu, move the script (the saved script application file) to your
~/Library/Scripts folder. You can also drag it to your Dock or make an alias for it on the Desktop.<br><br>
To debug, run the script within the Applescript Editor. Click on the event log tab at the bottom of the window. Click on the run icon. The results from the log statement will be shown at the bottom of the screen.
