SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Need suggestion for schedule time

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Need suggestion for schedule time
Author Message
Kevin H



Joined: 04 Oct 2004
Posts: 13

Post Need suggestion for schedule time Reply with quote

Hello,

I'd like a job to run from Monday to Friday, from 5:30pm to 7:30pm, executing every 5 mins.
Currently I have the schedule set at "All Day", from 5:30pm to 7:30pm and run every 5 mins. However, this executes it on the weekends as well.

This job checks an FTP server for a file, and does some transfers and a MailSend when it finds it.
Is there a way to schedule this so it doesn't run on weekends? I was thinking to build into the script to check if the day was Saturday or Sunday and to Exit if it was.


Mon Nov 22, 2004 3:43 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7970

Post Re: Need suggestion for schedule time Reply with quote

Because it is already a script type job you can easily make it to exit on a weekends before doing anything else.
Add the following lines in the beginning of the job script.

ChooseCase @T"d", END_DAY_CHECK
Case 1, 6
Exit
END_DAY_CHECK:

: Hello,

: I'd like a job to run from Monday to Friday, from 5:30pm to 7:30pm, executing
: every 5 mins.
: Currently I have the schedule set at "All Day", from 5:30pm to
: 7:30pm and run every 5 mins. However, this executes it on the weekends as
: well.

: This job checks an FTP server for a file, and does some transfers and a
: MailSend when it finds it.
: Is there a way to schedule this so it doesn't run on weekends? I was thinking
: to build into the script to check if the day was Saturday or Sunday and to
: Exit if it was.

Mon Nov 22, 2004 4:32 pm View user's profile Send private message
Kevin H



Joined: 04 Oct 2004
Posts: 13

Post Re: Need suggestion for schedule time Reply with quote

Just for my learning sake, since I'm not a programmer by any means...
This little bit of code checks for Case 1 and 6, and if it is, Exits.
If not, then it continues running from END_DAY_CHECK:?
I am assuming Case 1=Sunday and 6=Saturday.

Thanks again!

: Because it is already a script type job you can easily make it to exit on a
: weekends before doing anything else.
: Add the following lines in the beginning of the job script.

: ChooseCase @T"d", END_DAY_CHECK
: Case 1, 6
: Exit
: END_DAY_CHECK:

Mon Nov 22, 2004 5:34 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7970

Post Re: Need suggestion for schedule time Reply with quote

That's correct, @T"D" returns day number. In case of 1=Sunday and 6=Saturday the script simply exits.

: Just for my learning sake, since I'm not a programmer by any means...
: This little bit of code checks for Case 1 and 6, and if it is, Exits.
: If not, then it continues running from END_DAY_CHECK:?
: I am assuming Case 1=Sunday and 6=Saturday.

: Thanks again!

Mon Nov 22, 2004 5:41 pm View user's profile Send private message
Kevin H



Joined: 04 Oct 2004
Posts: 13

Post Re: Need suggestion for schedule time Reply with quote

Sorry, are you sure @T"D" returns the weekday number?
Because today is the 7th, and it's returning a 7 instead of a 3.

: That's correct, @T"D" returns day number. In case of 1=Sunday and
: 6=Saturday the script simply exits.

Tue Dec 07, 2004 12:11 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7970

Post Re: Need suggestion for schedule time Reply with quote

Sorry, @T"d" returns day of the month. If you need a week day number you can do this

Dim( week_day, number )
DayNumber( @T"mm/dd/yyyy", week_day )
ChooseCase week_day, END_DAY_CHECK
Case 1, 6
... and so on

.
To make it even more efficient you can avoid using week day numbers and instead use day names, for example

ChooseCase @T"dddd", END_DAY_CHECK
Case "Sunday", "Saturday"
... and so on

: Sorry, are you sure @T"D" returns the weekday number?
: Because today is the 7th, and it's returning a 7 instead of a 3.

Tue Dec 07, 2004 12:29 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.