Topic Options
#741 - 07/31/03 10:49 AM Running a Daily Job but it starts right away.
Remixkidd Offline
Junior Member

Registered: 04/23/02
Posts: 13
Loc: Washington DC
I run this script:
{
-name Net Stop Websense and SQL Server
-start -time 03:00:00 AM
-command -wait net stop WebsenseLogScheduler /y
-command -wait net stop WebsenseLogServer /y
-command -wait net stop mssqlserver /y
-command -wait net stop mssql$production /y
-command shutdown.exe /R /L /Y
-action -print Shutting Down Server
-start -inc 1 0 0 0
}

I don't want this to start right away but use the time that I have set on the start command. This is probobly a simple thing but cannot figure it out.

Top
#742 - 07/31/03 11:26 AM Re: Running a Daily Job but it starts right away.
Luke Tomasello Administrator Offline
Member

Registered: 09/17/00
Posts: 740
Loc: San Jose, CA., USA
Yep, it's an easy fix ;\)

##
# added -constrain directive
{
-name Net Stop Websense and SQL Server
-start -time 03:00:00 AM -constrain 0 0 5 0
-command -wait net stop WebsenseLogScheduler /y
-command -wait net stop WebsenseLogServer /y
-command -wait net stop mssqlserver /y
-command -wait net stop mssql$production /y
-command shutdown.exe /R /L /Y
-action -print Shutting Down Server
-start -inc 1 0 0 0
}


The -constrain directive tells WinCron to constrain it's execution to a 'time window'.
In the above example I've set that time window to 5 minutes.

You also need to move the -inc directive to the start line as well.
(gets rid of the second start command.)

Like this:

##
# added -constrain directive and fixed -inc directive
{
-name Net Stop Websense and SQL Server
-start -time 03:00:00 AM -constrain 0 0 5 0 -inc 1 0 0 0
-command -wait net stop WebsenseLogScheduler /y
-command -wait net stop WebsenseLogServer /y
-command -wait net stop mssqlserver /y
-command -wait net stop mssql$production /y
-command shutdown.exe /R /L /Y
-action -print Shutting Down Server
}
_________________________
Regards,
Luke Tomasello

Top
#743 - 09/14/06 10:35 AM Re: Running a Daily Job but it starts right away.
itachi Offline
Junior Member

Registered: 09/14/06
Posts: 1
Could you explain that to people who arent as smart as u and need it?

Top


Moderator:  Luke Tomasello