Home
»
Discussion Forums
»
Scripts & Agent Procedures
»
Comparing current time of day in script
Subscribe via RSS
Share this
Similar Posts
Compare or evaluate time in script
by
LegacyPoster
on
Oct 14, 2009
Script to compare time to an NTP server
by
LegacyPoster
on
Mar 21, 2007
Compare agent time to KServer time
by
Dan
on
Nov 4, 2010
Suggested Answer
Write/Compare Date in Script
by
eperson
on
Jul 31, 2012
Compare dates in a kaseya script
by
LegacyPoster
on
Jan 14, 2010
View More
Details
1
Reply
0
Subscribers
Posted
over 12 years ago
Scripts & Agent Procedures
Comparing current time of day in script
Posted by
LegacyPoster
on
Nov 4, 2008 10:48 AM
Hello. I am looking for a little help.
I have a defrag script for workstations that is scheduled to run between 1AM and 4Am in the morning, every Tuesday. Right now, the script is configured to Skip If Offline - so as t not interfere with userstrying to use their PC, if they had not left it on.
I would like to somehow check the current time of the Agent in an IF statement to see if the current time is between 1AM and 4AM. If so, then call my defrag script. If not, then call a seperate Yes/No prompt sub-script that tells the user that an off-hours defrag was missed, would they like to do it now?
But I do not know how to check and see if the current Agent time is between 1AM and 4AM in an IF statement in a script.
Any ideas?
As always, thanks in advance.
Lloyd
Legacy Forum Name: Comparing current time of day in script,
Legacy Posted By Username: lwolf
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
Posted by
LegacyPoster
on
Nov 5, 2008 5:26 PM
This is achievable with two scripts, but it would really be great to be able to do a bit more in the IF comparison section of scripts. Maybe there is a way....
With two scripts, use the first script to get the variables you need to compare... compare them if you have to. Call the second script. Use the IF comparison in the second script to determine the action.
Legacy Forum Name: Scripts Forum,
Legacy Posted By Username: mparr
You have posted to a forum that requires a moderator to approve posts before they are publicly available.