Run a sync with the command line

You can run synchronizations in Google School Directory Sync (SDS) from the command line. You can incorporate syncs into any scheduling or batch script you use. You can perform a range of actions, such as:

  • Read a specified file.
  • Ensure that a sync is not already running.
  • Generate a list of changes.
  • Apply any changes.

Use the command line to run a sync

  1. Enter the sync-cmd [argument] file name command on a single line.
  2. Replace file name with the name of the XML file that you created in Configuration Manager.
  3. Customize your sync using any of the arguments listed below.

Note: If you run the command without any arguments, you’ll get an error message directing you to run sync-cmd-sds -h for help.

Customize your sync

sync-cmd command arguments

You can also access this information by running the sync-cmd-sds -h command in the directory where SDS is installed.

Argument Description
-a,--apply

Use this to apply any detected changes. If you don’t use this tag, a sync is run as a test only and no changes are made to your G Suite account. For the best results, run a test without this argument before running a sync with it.

-c,--config file name

Use this to specify the configuration file to load. The sync won’t happen unless you specify a valid XML file with this argument.

-d,--deletelimits

Use to omit any configured deletion limits.

-f,--flush

Clears the cache. Improper use can cause performance degradation. Don't use this option unless directed to do so by support.

-g,--groups

Excludes groups from the sync. Use this option if you want to sync users, but not groups.

-h,--help

Displays help information.

-l,--loglevel value

Use this to override the default or configured log level with a specified value. Valid values (in increasing order of detail) are FATAL, ERROR, WARN, INFO, DEBUG, and TRACE. In most cases, the recommended log level is INFO.

-o,--oneinstance

Restricts the running syncs to one instance per configuration file. Only valid with -a.

-ou,--orgunit

Use this to exclude organizational units from the sync.

-r,--report-out

Writes reports to a specified output file in addition to writing them to the log.

-u,--users

Use this to exclude users from the sync. Use this option if you want to sync groups, but not users.

-v

Displays short application-version information.

-V

Displays detailed application-version information, but does not synchronize it.

Related topics

Was this helpful?
How can we improve it?