syncing folders

couzteau

Registered
i want to write a script that syncs folders.

ie watch folder A and copy its contents to folder B. it's important that nothing is copied from folder A that hasn't been fully received.

it should also be possible to copy hirarchies of folders from A to B.

what are the best tools to solve this problem?

thanx
 
I second those two recommendations - I regularly mirror my main drive each night to another drive as a bootable backup using psync - works great - and the syntax is easy enough for anyone.

psync -d /source-volume /dest-volume

those could of course be directories also. The -d option indicates you want to remove anything in the dest that is not in the source - so you get a true mirror copy.

For your purposes - folder to folder - you could write a cron task that runs your psync line every hour/mins/days what ever you want.
 
Uh guys, you SHOULD tell him that HFS+ has other file attributes which will not be copied this way. Things like finder flags, creation dates, icon locations, file types, file creators, etc.
 
yes - psync is def hfs/osx compatible. I have used it for over 6 months - backing up system disk each night. Copy is completely bootable.
 
Originally posted by G. Peretz
psync does retain resource fork data such as finder flags, creation dates, icon locations, file types, file creators, etc. About the only thing it seems to fail to preserve is Finder info comments.

You can get the command line utility here:
www.dan.co.jp/cases/macosx/backup-volume.html

or paired up with the Cocoa front end here:
http://sourceforge.net/projects/psyncx

Finder flags, creation dates, icon location, file types, and file creators are NOT IN THE F***ING RESOURCE FORK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Before you post maybe you should know WTF you're talking about!
 
The Finder flags, creation dates, file types, and file creators are IN ALL THE F***ING BACKUPS I HAVE MADE OVER THE LAST SIX MONTHS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I can not vouch for icon location as I rarely use icon view.
 
Sigh...

Look dude, I'm trying to get the facts STRAIGHT!

You said:
psync for resource-fork dependent files.

To which I pointed out that backing up the resource fork is NOT going to copy all HFS+ data. You then attempted to correct me by saying these data are backed up because psync backs up the resource fork! I wouldn't mind being corrected if you actually knew WTF you were talking about. I never claimed to be an expert on psync, I only responded to factual errors on your part.

If you wish to correct me perhaps you should get your gawd damn FACTS STRAIGHT!

Perhaps I was a bit snippy, but seriously I just corrected you by saying these data are NOT in the resource fork, then you contradict me by repeating your misinformation that they are in the resource fork! That was really annoying |-p
 
A question on the lighter side of things here. can this be done to a network drive? for example if i have a shared drive mounted, can i sync the folder to a completely different computer?
 
An AppleShare volume?

I know Sync (an application) is designed to work that way, even mounting the volume for you.
 
Back
Top