Introduction - What is SINC32+
- SINC32+ is an enhanced version of SINC32.
- SINC32+ is similar to cron available on Unix.
- Extension for extra functionality.
- See ReadMe for detail description.
Installation
- No installation required.
- Simply unzip the downloaded ZIP file to <path-of-your-choice>.
Launch
- Following these simple steps:
- edit sinctab.stf (with your favorite editor).
- launch <sinc32-path>/sinc32.exe (from anywhere in your PC).
- sinc32.exe (or a shortcut) can be added to the "StartUp" folder if you want SINC32+ to be run automatically when MS-Windows starts.
Command Line Options
- -h Quick help menu
- -q Quite mode - logging is disabled
- -t specify check interval (in seconds)
- -l <filename> Write log messages to <filename> instead of default (sinc32.log)
- -f <filename> Use <filename> as crontab file instead of default (sinctab.stf)
- -d (*debug*) Open a console when launch
- -i (*debug*) Enable interactive console (NOT-YET-IMPLEMENTED)
crontab (Configuration File) Explained
- Default location: <sinc32-path>/sinctab.stf
- Content format similar to Unix CRONTAB.
- Global extensions
Any line in the crontab starts with #; is treated as global extension.
- INTERVAL=nnnn (in seconds)
specify checking interval. It is a simply numeric number.
e.g.
#; INTERVAL=120
- LOGGING=(on|off)
enable/disable logging to file.
- LOGFILE=<full_path_to_log_file>
write log messages to specified file.
- EDITOR=<full_path_to_editor>
specify editor of your choice. Full pathname required.
e.g.
#; EDITOR=C:\WinTools\Notepad2.exe
In addition to what specified above, local environment variables
can also be set and referenced later.
e.g.
#; MY_HOME_DIR=C:\WinTools
- Time extensions
An extension is added to the weekday time element for individual command. Let me explain this by example,
- 0 1 * * 2 tuesday_task.bat
this normal crontab entry shows that the "tuesday_task.bat" is to be run at 1:00 every Tuesday.
- 0 1 * * 2:2,3 tuesday_task.bat
this crontab entry indicates that the "tuesday_task.bat" is to be run at 1:00 on the 2nd and the 3rd Tuesday.
- Command extensions
These extensions are set by individual command. Multiple extensions can be provided, however, they follow one sinlge #;.
- Run-once commands are prepended with a plus (+) sign. These commands will only be executed once. If no specific value set in time and date fields, it will be executed when SINC32+ launches, otherwise, it will be executed once when time and date is matched.
e.g.
+* * * * * run_once_command.exe
+* * 12 3 * run_once_command_on_next_March_12th.exe
- StartIn=<path-to-start-in-directory>
specify the working directory for the command.
e.g.
StartIn=C:\WinTools
for directory path that contains space(s), enclose it with double
quotes (").
e.g.
StartIn="C:\Program Files\WinTools"
- StopAfter=[aW][bD][cH][d[M]]
specify how long can the process be hanging around. SINC32+ will attempt to terminate the process after the specified time.
e.g.
StopAfter=3D6H - 3-day and 6-hour
StopAfter=180m - 180-minute
StopAfter=180 - default unit is minute, this means 180 minutes
- StartDate=yyyy/mm/dd
specify starting date for the command. Command will only be run on and after this date.
e.g.
StartDate=2005/2/22
- EndDate=yyyy/mm/dd
specify ending date for the command. Command will NOT run on and after this date
e.g.
EndDate=2005/2/22
- NoLog=n
control logging for the command. No log will be written if this value is set to non-zero.
e.g.
NoLog=1
- Use local environment variable in command line
Local environment variables set previously (as well as system environment variables) can be
used in any command line. To reference an environment variable, it must be specified in
${NAME} format where name is the environment variable name.
e.g.
0 1 * * 2 ${MY_HOME_DIR}\tuesday_task.bat
Tricks and Tips
An example
# one-time program
#
+* * * * * calc.exe
# one-time program run on next March 12th
#
+* * 12 3 * scan c:
# pop3 spam checking (multiple times per day)
#
45 7,11,15,18,21,1,4 * * * C:\Perl\bin\perl.exe -Id:\Usr\Pop3Smtp d:\Usr\Pop3Smtp\pop3check.pl #; StartIn=D:\Usr\Pop3Smtp
# daily run (21:01 everyday)
#
1 21 * * * C:\CommonBatch\_DailyRun.bat
# WebMail (11:50am 8th of every month)
#
50 11 8 * * C:\PROGRA~1\INTERN~1\IEXPLORE.EXE http://mail.yahoo.com
# TimeCard (11:50am Friday of 2nd & 4th week of every month)
#
50 11 * * 5:2,4 C:\PROGRA~1\INTERN~1\IEXPLORE.EXE http://localhost/timecard.html
# TIPS: Windows98 users can use COMMAND.COM to launch the batch file to prevent the hang-over DOS window.
#
#* * * * * c:\command.com /C run_and_exit_Win9x.bat