Search code examples
objective-cosx-snow-leoparddaemonmobileme

Is there a way to programmatically start the Mobile me synchronization?


What I would like to create is a utility that runs the Mobile Me synchronization basing a defined schedule, and avoid it starts when Time Machine is already backing up files.

Is there a way to invoke the Mobile Me synchronization from an application, or a daemon?


Solution

  • Use dotmacsyncclient through NSTask or NSAppleScript, location:

    /System/Library/PrivateFrameworks/DotMacSyncManager.framework/Versions/A/Resources/
    

    Usage:

    Usage: mobilemesyncclient [options], version 446
        --sync
            Options:
            --entitynames <entities to sync>
            --dataclass <dataclass to sync>
            --username <account username>
            --password <account password>
            --pushtruth
            --pulltruth
        --dumpchangelog <changelog path>
            Options:
            --tdir <target directory>
        --dumpchanges <changelog number> --dataclass <dataclass name>
        --listdataclasses
            Required:
            --username <account username>
            --password <account password>
        --listdataclass <dataclass name>
            Required:
            --username <account username>
            --password <account password>
        --downloaddc <dataclass name> --tdir <target directory>
            Required:
            --username <account username>
            --password <account password>
        --uploaddc <dataclass name> --sdir <source directory>
            Required:
            --username <account username>
            --password <account password>
            Options:
            --clear
            --needstruth
        --removeclient <client name>
            Required:
            --username <account username>
            --password <account password>
        --listclients
            Required:
            --username <account username>
            --password <account password>