Home
»
Discussion Forums
»
Scripts & Agent Procedures
»
Compare file time stamps from two different computers using variables
Subscribe via RSS
Share this
Similar Posts
Agent Procedure - Comparing two SQL query results into log files as variables
by
jhinder
on
Jul 1, 2015
Monitor if File Date/Time Stamp Changing
by
LegacyPoster
on
Sep 21, 2009
Agent procedure to create time-stamped text file
by
Me
on
Nov 25, 2013
Verified Answer
Script to generate a date and time stamp for naming files
by
LegacyPoster
on
Sep 29, 2007
Agent Time stamping confusion
by
roba0665
on
Apr 18, 2011
View More
Details
2
Replies
0
Subscribers
Posted
over 10 years ago
Scripts & Agent Procedures
Compare file time stamps from two different computers using variables
Posted by
LegacyPoster
on
Jun 17, 2010 5:55 AM
Greetings,
I am trying to put together a set of scripts that can pull the time stamp on one computer and check it against another computer using a different script. For Example,
ComputerA - Runs ScriptA - Creates VarA and places the time stamp inside it
ComputerB - Runs ScriptB - Creates VarB and places the time stamp inside it
Master Script Calls Script A first, collects value, launches Script B, collects second value and compares the two using an IF statement.
As you have probable guessed, it didnt work. I am assuming that you cant carry over Variables from one script to another.
So, I have the idea of updating a vSystemInfo field I would create for each computer and then compare the two variables directly off of the KServer.
The only problem, How do I pull this data our of the database?
Legacy Forum Name: Compare file time stamps from two different computers using variables,
Legacy Posted By Username: ITRTech
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
Posted by
LegacyPoster
on
Jun 18, 2010 2:07 PM
If you store the data in a SystemInfo custom field, call it in a script like this:
#vSystemInfo.#, i.e. if you had a field called TimeStamp in Audit, use this: #vSystemInfo.TimeStamp#
Cheers,
Josh
EDIT: Having said that, variables WILL carry from one script to another providing you are executing the second script from *within* the first, not just concurrently or on the same machine. So perhaps there may have been something else causing a problem. To test, try adding a step in the second script 'Write Procedure Log Entry', then in the field for that step, put the two variables in question. After running you should see evidence in the logs of the two values.
Legacy Forum Name: Scripts Forum,
Legacy Posted By Username: josh.tipping
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
Posted by
LegacyPoster
on
Jun 18, 2010 10:42 PM
Thanks for the information Josh. Although, I have run into another stumbling block.
I can attack this problem two ways.
1. create a master script that calls two separate scripts that go out and find the variable, and then pull those variables back to the master script and compare the values
2. create a master script that calls two separate scripts that go out and find the variable but place the data in a custom field under system info. The master script compares the values from each field and compares them.
Problem:
How do you run the second script or pull the system info field on another agent? I've tried updating the SQL expression to include the machine.id such as #MachineID.vSystemInfo.TimeStamp# but that doesnt work. When I go to schedule a procedure to run, it doesn't give me a choice on what machine to run it on.
Legacy Forum Name: Scripts Forum,
Legacy Posted By Username: ITRTech
You have posted to a forum that requires a moderator to approve posts before they are publicly available.