05-28-2013
ksh to check second time difference between two servers
I am currently setting up a public key authentication between servers. The goal is to get the date via `ssh hostname date` on all the 4 remote servers , put the value in a text file on the central server and compare the date (specifically seconds) for each server date output to check if time is actually sync. I know there will be a second interval while logging in to the system via ssh and retrieving the time. But I am thinking of a margin like 3 - 5 seconds.
Is there any specific script to compare the output of date command and get the difference of seconds. I am thinking of creating a script to get the seconds via 'cut' command but it easily breaks if it reaches ":00" and the result will be inaccurate.
Thanks.
Last edited by Scott; 06-01-2013 at 03:50 AM..
Reason: Moved thread - Not an AIX issue
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to write a Kshell program which will start the servers(Oracle,DataIntegrator).
Can anybody help me with this?
I would appreciate your help.
Thanks in advance (0 Replies)
Discussion started by: pari111222
0 Replies
2. Shell Programming and Scripting
Please ignore.
I found the answer at:
https://www.unix.com/shell-programming-scripting/24557-difference-between.html (1 Reply)
Discussion started by: JamesByars
1 Replies
3. UNIX for Dummies Questions & Answers
system = AIX
How can I explain this.....
Keep in mind I do not want to login to the boxes, persay, and that I am fairly new to scripting and unix.
I want to use SSH.
I have a script on server1, this is where I want it to run from.
I have server2 and server3, where I want the script to... (2 Replies)
Discussion started by: cml2008
2 Replies
4. Shell Programming and Scripting
Hi all
I am running a major script of my application in development for implementing code changes for process improvement in time. The script runs in production once in a month . It takes 8 hours 30 mins in Production server . what surprice me is , when I run the same script in development server... (9 Replies)
Discussion started by: sakthifire
9 Replies
5. Shell Programming and Scripting
Hello All,
I have a problem calculating the time difference between start and end timings...!
the timings are given by 24hr format..
Start Date : 08/05/10 12:55
End Date : 08/09/10 06:50
above values are in mm/dd/yy hh:mm format.
Now the thing is, 7th(08/07/10) and... (16 Replies)
Discussion started by: smarty86
16 Replies
6. Shell Programming and Scripting
Hello,
I am looking for a way for a server to launch a connection command to one of the other servers where the connection command has already embedded in it a server name, user name and a password. (2 Replies)
Discussion started by: LiorAmitai
2 Replies
7. UNIX for Dummies Questions & Answers
Hi ,
What is the diffence between executing the script like
./myscript.ksh
. ./myscript.ksh
I have found 2 difference but could not find the reason
1. If i export a variable in myscript.ksh and execute it like . ./myscript.ksh the i can access the other scripts that are present in... (5 Replies)
Discussion started by: max_hammer
5 Replies
8. Shell Programming and Scripting
HI all
I have written a ksh to execute PL/sql procedure and generate the log file. The script is working fine to the extent of calling the taking input, executing PL/SQL procedure.
On one server the log file is getting generated properly. i,e it shows the DBMS output . The log file size was... (9 Replies)
Discussion started by: ramakrishnakini
9 Replies
9. Shell Programming and Scripting
Hi Friends,
I have 2 varaibles which contain
START=`date '+ %m/%d/%y %H:%M:%S'`
END=`date '+ %m/%d/%y %H:%M:%S'`
i want the time difference between the two variables in Seconds.
Plz help. (2 Replies)
Discussion started by: i150371485
2 Replies
10. Shell Programming and Scripting
I was looking at this script which outputs the two lines which differs less than one sec.
#!/usr/bin/perl -w
use strict;
use warnings;
use Time::Local;
use constant SEC_MILIC => 1000;
my $file='infile';
## Open for reading argument file.
open my $fh, "<", $file or die "Cannot... (1 Reply)
Discussion started by: cele_82
1 Replies
LEARN ABOUT DEBIAN
wa_keyring
WA_KEYRING(1) WebAuth WA_KEYRING(1)
NAME
wa_keyring - WebAuth keyring manipulation tool
SYNOPSIS
wa_keyring [--hv] -f file command [arg ...]
wa_keyring -f keyring add valid-after
wa_keyring -f keyring gc oldest-valid-after-to-keep
wa_keyring -f keyring list
wa_keyring -f keyring remove id
DESCRIPTION
wa_keyring is a command line tool to manage WebAuth key ring files, which contain the private AES keys used by mod_webauth and mod_webkdc.
It supports the following individual commands:
add valid-after
Adds a new key to the key ring. valid-after uses the format:
nnnn[s|m|h|d|w]
to indicate a time relative to the current time. The units for the time are specified by appending a single letter. That letter can be
any of s, m, h, d, or w, which correspond to seconds, minutes, hours, days, and weeks respectively.
For example: 10d is 10 days from the current time, and -60d is 60 days before the current time.
gc oldest-valid-after-to-keep
Garbage collects (removes) old keys on the key ring. Any keys with a valid-after date older then the specified time will be removed
from the key ring.
The format for oldest-valid-after-to-keep is the same as valid-after from the add command. Note that this means that times given to
the gc command should generally be negative, to remove keys that have expired in the past.
list
Lists all the keys in the key ring. By default, a brief listing is used, but a verbose listing can be requested with the -v option.
The following fields are present in a short listing:
id The index/position of the key in the key ring.
Created
The date the key was created.
Valid after
The date at which the key becomes valid (in other words, the point at which the WebAuth server will start using it to encrypt and
decrypt new data).
Fingerprint
The MD5 digest of the key data. Used to compare keys in two key rings.
The following fields are present in the long listing:
Key-Id
The index/position of the key in the key ring.
Created
The date the key was created.
Valid-After
The date at which the key becomes valid (in other words, the point at which the WebAuth server will start using it to encrypt and
decrypt new data).
Key-Type
The type of key. Currently, AES is the only supported key type.
Key-Size
Length in bytes of the key.
Fingerprint
The MD5 digest of the key data. Used to compare keys in two key rings.
remove id
Remove the key with ID id from the key ring.
EXAMPLES
Add a key to the keyring valid as of the current time:
wa_keyring -f keyring add 0d
Add a key to the keyring that will be valid three days from now:
wa_keyring -f keyring add 3d
Remove keys from the key ring that became invalid more than 90 days ago:
wa_keyring -f keyring gc -90d
Remove the first key in the keyring.
wa_keyring -f keyring remove 0
Display a verbose listing of all of the keys in the key ring:
wa_keyring -f keyring -v list
Note that a WebAuth server will normally manage its keyring file by itself, and wa_keyring is normally only used for debugging purposes.
However, if you are setting up a load-balanced pool of servers that need to all share the same keys, turn off automatic keyring handling by
putting the line:
WebAuthKeyringAutoUpdate off
to your Apache configuration, running a script periodically from cron on one server that does something like:
wa_keyring -f keyring gc -90d
wa_keyring -f keyring add 2d
and then copying (in a secure manner!) the new keyring file to all of the other servers.
AUTHOR
Roland Schemers <schemers@stanford.edu>
4.1.1 2012-04-25 WA_KEYRING(1)