Directory Wizards Inc
Solutions for your directory needs.
Products Support Knowledgebase Blog About
Knowledgebase

Categories
Active Directory
ADAM
Address Manipulation
Exchange 200x
Exchange 5.5
Exclusions
General
Group as Group Sync
Groupwise
LDAP SSL
LDIF
Licensing & Keys
Lotus Notes / Domino
Map Files
Master/Spoke
Netscape
ODBC
Oracle
Outlook
Outlook 2003
Postini
Profiler
SharePoint
Troubleshooting
Whitepapers
Windows 2000
RSS Feed DirWiz Knowledgebase RSS Feed

Automating (Scheduling) your SimpleSync connections
Category: GeneralLast Updated: 2008-04-15
 

Scheduling

Since SimpleSync is command line based.  You can use any number of methods to schedule synchronizations. One of the easier methods is to use the NT 4.0/2000/2003 Scheduler service and a batch file.


The batch file has a couple of requirements:

 

·      It must change to the local drive where SimpleSync is installed.

·      It must change to the local directory of the Synchronization executable.
Be sure to put each command on a separate line.

·      Previous versions of SimpleSync utilized multiple individual executables to kick off the sync process. Which executable was run depended on the directory format (ldap, odbc, ldif).  In this latest version of SimpleSync, all sync processes are kicked off using the exact same executable, shell.exe.

·      If you group your connections in Folders, you must specify the Folder name when calling the connection.
i.e. Shell “Folder\YourConnection”

 

Example Script #1 – One command per connection

Here is an example of a batch script to kick off SimpleSync v4.0 connections, one command line per connection:

c:
cd \SimpleSync-v4\Programs
shell.exe "in-Paris-to-Master"
shell.exe "in-Denver-to-Master"
shell.exe "in-NY-to-Master"
shell.exe "out-Master-to-Paris"
shell.exe "out-Master-to-Denver"
shell.exe "out-Master-to-NY"

Here is an example of the same connections if they are in two folders (In/Out) instead of using naming conventions

c:
cd \SimpleSync-v4\Programs
shell.exe "IN\Paris-to-Master"
shell.exe "IN\Denver-to-Master"
shell.exe "IN\NY-to-Master"
shell.exe "OUT\Master-to-Paris"
shell.exe "OUT\Master-to-Denver"
shell.exe "OUT\Master-to-NY"

Example Script #2 – Multiple connections per command

Here is an example of a batch script to kick off a subset of SimpleSync v4.0 connections with a single command.

c:
cd \SimpleSync-v4\Programs
for /D %%D in (..\connections\in*.) DO ..\Programs\shell.exe "%%D"
for /D %%D in (..\connections\out*.) DO ..\Programs\shell.exe "%%D"

In the above example, naming conventions are used to group connections…all connections that load the master are prefixed with "in". All connections that push from the master, out to other directories, are prefixed with "out".  Using this two line batch script, any connection created with a prefix of "in" or "out" are automatically included in the execution of the scheduled batch.

Here is an example of the same connections if they are in folders, instead of using naming conventions:

c:
cd \SimpleSync-v4\Programs
for /D %%D in (..\connections\IN\*.) DO ..\Programs\shell.exe "%%D"
for /D %%D in (..\connections\OUT\*.) DO ..\Programs\shell.exe "%%D"
 

Scheduling Batch Execution

Start the Scheduler Service
Start/Settings/Control Panel/Services

Or, configure Startup to make the service start at boot up.

Lets say that your batch file is called \SimpleSync-v4\runsync.bat and you would like to have it run every day at 9:00 am. This can be done buy using the AT command in an CMD window. For syntax on the at command type 'at /?' from the CMD prompt.

at \\MyServer 9:00 /EVERY:SU,M,T,W,TH,F,S "C:\SimpleSync-v4\runsync.bat"

To view the scheduled events type "at". Remember, a log file is generated with each run. Review these logs regularly to ensure your connection is running properly.

*SimpleSync is single thread so more than one occurrence of a program can run at a time. Take your bandwidth into consideration when attempting to run more than one sync.

Scheduling Log File Management
See
Scheduling Log File Management for information on automating your Log File Management.

 
Slashdot StumbleUpon