Skip to main content.

TimeSync Reference

Command line arguments

Some of the arguments have been discussed earlier. For normal usage those are sufficient. Special circumstances may require the advanced control arguments dealt with in this section.

/install
installs the service. Should be used only when installing the service. Once the service is created it starts it automatically. If the service is already installed, it does an implicit remove before installing it anew.
/remove
deinstalls the previously installed service. It deletes the service after stopping it.
/domain
/domain[=<domain name>[,<#messages>]] specifies that the time source should be the PDC of that domain. If domain name is omitted the domain of the machine is used.For example /domain=sales,7 will cause TimeSync to send 7 messages to the PDC of sales and average the time from all the received messages. If <#messages> is left out the default is 5.
/nt_machine
/nt_machine=\<nt machine name>[,<#messages>] to use that node as time source. If the back-slashes are omitted they are put in by TimeSync before passing the names to the API calls. If <#messages> is left out the default is 5.
/tcp_machine
/tcp_machine=<machine name>[,<#messages>] to use TCP port 37 of that Unix (or whatever) node as time source. If <#messages> is left out the default is 5.
/udp_machine
/udp_machine=<machine name>[,<#messages>] to use UDP port 37 of that Unix (or whatever) node as time source. If <#messages> is left out the default is 5.
/ntp_machine
/ntp_machine[=<machine name>[,<# messages>]] to use an NTP server as time source. If the machine name is omitted, it waits for an NTP broadcast. If <#messages> is left out the default is 5. Thus, /ntp_machine without a <machine name> and <#messages> will cause TimeSync to wait for 5 broadcast messages. TimeSync waits for up to 2 minutes for a reply or a broadcast message.
/period
/period=<hours>:<minutes>:<seconds> to specify update frequency. The default is 8 hours. /period=4:0:0 will cause it to synchronize every 4 hours.
/at
/at=[+]<hours>:<minutes>:<seconds> to specify the start time for synching. The + sign signifies that the time that follows is relative; absence of the + indicates absolute time. If this argument is omitted the default is at startup, i.e. it is assumed to be /at=+0:0:0. Thus, if /at=+0:0:10 specifies that TimeSync should start its operation 10 seconds after start-up whereas, /at=0:0:10 specifies that it should start 10 seconds after midnight.
/adjust
/adjust[=(yesªno)] to specify whether TimeSync should slowly adjust the clock to make up for the deviation or if the time should be jammed into the clock. By default, adjustment is enabled; the /adjust control argument without "=yes" also indicates that adjustment is desired. If you are one of the few who do not want adjustment you must specify "/adjust=no". Note that this behavior is new in version 1.4: earlier versions had a default of no adjustment. Adjustment will cause the NT clock to be speeded up or slowed down by a small amount during each clock interrupt (usually every 10 milliseconds). Depending on the actual deviation this might take up to 30 minutes or half of the update frequency (specified with /period). This feature is useful if there are programs that depend on the fact that time cannot go back. For example, make looks at the modification time of files in order to decide what has to be generated anew.
/immediate
to run the program without installing a service. It synchronizes once and then exits. This is mainly used for testing. It ignores the /at argument, if specified, and assumes that /at=+0:0:0 was entered (synchronize right away).
/log
/log=<device or file>[,<size>] to redirect the messages from TimeSync to another file or device. The default is console during interactive use and the event log when it is running as a service. To specify the console type /log=Console, for the event log use /log=EventLog or to output to a file use /log=somefile.log. <size> indicates the maximum number of kilobytes the log file may grow to. If <size> is omitted the default is 10K bytes. The file will be handled like a circular buffer; when it gets to the end it will continue at the beginning of the file. Each line in the log device starts with the date, time and severity.
/trace
/trace[=<trace level>] to set the level of desired output to a logging device. Outputs less or additional information to the current log device. Permitted trace levels are debug, success and error. If debug is specified all debug, success and error messages are shown; specifying success will cause success and error messages to appear; specifying error will cause TimeSync to display error messages only. For example, if you just want to see error messages use /trace=error. If /trace is not specified it defaults to /trace=success, if /trace is specified without a trace level, it defaults to /trace=debug. The table summarizes what is described above.
/trace=debug all debug, success and error messages
/trace=success all success and error messages
/trace=error error messages only
/trace equivalent to /trace=debug (see above)
<none> equivalent to /trace=success (see above)
/file
/file=<parameter filename> to specify additional parameters through a file. In the file each parameter must appear on a line by itself. All characters from a # sign to the end of the line are considered as a comment; comments are ignored. This parameter makes it easy to remove and install TimeSync without having to remember a whole bunch of arguments. It is also useful if you intend to use the same settings on several machines. Every time TimeSync starts up it will re-read this file. You could therefore put control arguments to override the installed ones by writing them into to file and restarting TimeSync. If the file does not exist it runs with the installed parameters. There is one exception to the overriding rule: if any time sources are mentioned in the file only those are taken; if no time sources are mentioned the installed ones are used. TimeSync will not append time sources in a configuration file to the installed ones.
/url
/url=<URL of file> to specify additional parameters through a URL (Uniform Resource Locator). With this feature you can store the arguments for TimeSync on a web server and have TimeSync fetch them by specifying a control argument like "/url=http://www.company.com/data/timesync-parameters.txt".  In the same conditions for the /file argument applies to /url as well. Supported URL protocols are HTTP and FTP; others like file and HTTPS might work but they have not been tested.A final caveat: if the server does not find the specified file it usually sends back a descriptive error message that TimeSync could in very rare cases mistakenly consider as the parameter file. TimeSync has been tested with several popular web servers. Note that this feature requires WinInet.DLL which gets installed on your system with Internet Explorer 3.x and above. WinInet.DLL will not be required if you do not use this control argument.
/max_deviation
/max_deviation=<#milliseconds> to indicate what the max tolerated deviation is. If the deviation is more than this amount TimeSync will not try to correct it. This might indicate serious problems with the time source or wrong setting of the time or time zone by the administrator. The default value for the maximum deviation is 10 minutes. If 0 milliseconds is specified, it indicates that there is no max tolerated deviation and hence it will not bother to check the deviation. The use of this is not recommended but it is there for those who have been clamoring for this feature.
/max_network_delay
/max_deviation=<#milliseconds> specifies what the maximum tolerated network delay is for time queries. If it is more than the maximum value the message is ignored. The default value for this is 1 second. You might want to set it to a higher number if the time source is far away from the machine or if the available network bandwidth is insufficient. If 0 milliseconds is specified, it indicates that there is no max tolerated network delay and hence it will accept any network delay.
/select
/select=<#sources>,<#periods>,<mode>. This introduces fault-tolerance features to TimeSync. Of the multiple time sources that may be specified, a subset are chosen based on the information given in this control argument. The remarks section has an example and the FAQ discusses this in detail with a sample configuration file.
<#sources> The maximum number of machines that are to be elected as definitive time sources. This must be a number smaller than the total number of machines that were specified with /domain, /nt_machine, /tcp_machine and /ntp_machine put together. The selection criterion is the network delay of the time messages.
<#periods> The number of synchronization cycles for which TimeSync should use the time sources that were elected. At the end of this duration another election is held.
mode The optional restricted mode is turned on by the letter 'R'. If specified, it indicates that TimeSync should consider the first <#sources> as elected and not attempt to contact all the specified sources. This reduces the network load but runs the risk of not using the best time sources. The order of appearance of the time sources during installation is therefore significant.
/status
Displays if TimeSync is installed and if it is currently running. Some important parameters are displayed as well.

Although there are a large number of arguments, I set up my personal machine with the following simple command line: TimeSync /install /adjust /tcp_machine=horus /trace /log=timesync.log