 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Kevin H
Joined: 04 Oct 2004 Posts: 13
|
|
Need suggestion for schedule time |
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7970
|
|
Re: Need suggestion for schedule time |
|
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 |
|
 |
Kevin H
Joined: 04 Oct 2004 Posts: 13
|
|
Re: Need suggestion for schedule time |
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7970
|
|
Re: Need suggestion for schedule time |
|
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 |
|
 |
Kevin H
Joined: 04 Oct 2004 Posts: 13
|
|
Re: Need suggestion for schedule time |
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7970
|
|
Re: Need suggestion for schedule time |
|
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 |
|
 |
|
|
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
|
|
|