I noticed a new post on a very old thread on the Mac OS X Hints forums site, which was about being able to start a sync to .Mac (MobileMe) from the command line. The new post showed how to use an AppleScript to control the MobileMe preferences pane and then click the Sync Now button.
While this may work, I suspected that there must be a better way, and so I had a dig around. I found dotmacsyncclient, located in /System » Library » PrivateFrameworks » DotMacSyncManager.framework » Versions » A » Resources. Further investigation showed that, indeed, you can start a sync from the command line -- and much more.
Note that the following examples assume you have cd'ed into the above directory first...
dotmacsyncclient sync
Read on for some other uses of this program, as well as a caution on its use.
To see the current sync status, use dotmacsyncclient status; this will print a report showing the exact date and time of the last sync for your data (contacts, calendars, etc.). To get a list of registered clients (Macs) on .Mac, use:
dotmacsyncclient listdmclients --u DotMacUserName
You will be asked for your password when using listdmclients. As you will be logging into .Mac, the password must be that of your .Mac account.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20080828133731218