Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tekboi

macrumors 6502a
Original poster
Aug 9, 2006
731
145
EasŦcoast
I have a script written for personal usage that will duplicate the my home folder to a shared server at work. But I want to make this more portable so that I can share it with co-workers who can run it without having to touch much code.

There is also the issue it not running more than once because there is already a previous file from running the script once. I get the error saying that "An item with the same name already exists in this location.


How can I achieve this? Here is the code I currently have:

Code:
set vserver to POSIX file "/Volumes/(user)"
set source to POSIX file "/Users/(homefoldername)

tell application "Finder"
    duplicate source to vserver
end tell
 

superscape

macrumors 6502a
Feb 12, 2008
937
223
East Riding of Yorkshire, UK
Yeah, rsync may well be the way to go. It has the advantage of not copying files that already exist on the server. So, for example:

Code:
rsync -av ~/ /path/to/folder/on/server

If you really want it as part of an AppleScript then:

Code:
do shell script "rsync -av ~/ /path/to/folder/on/server"

I suggest you look at the man page for rsync, you'll probably want to check and tweak some of the options.

Good luck
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.