I'm using a debian variant. My system clock already auto synchronizes. I'd like to have some sort of alert or log entry if the time is ever off by more than a particular amount. My first choice is to have a new file created on the desktop each day that there is a slip greater than the specified time.
You can look at the last line of output from ntpdate -d which gives you the offset from the time servers defined either on the command line on in /etc/ntp.conf
Filename drift - don't know Debian but it should be in the same directory tree as some other ntp files. It can be named drift or ntp.drift. Some systems have it in /etc/[something] other have it in /var/lib/ntp It gives you an estimate of your computer's clock accuracy - what it is try to correct. The values are ppm. Not seconds.
So, in an 86400 second day 10ppm is 864ms per day correction required. What this means is that ntp has had to add or subtract (if negative) that amount averaged over days of uptime. If you reset file the drift file every day
you get an approximation of the corrections going on for that day.
If you check the file periodically and find major changes (you decide the definition of major) you can report a problem.
Now. Locality of the time server, network, local cpu, and the stratum of your time server all affect accuracy. You should have a single server in your network that connects to a known lower stratum time server. If your time server is in house and NOT going outside, good luck with correct time. If this is for legal purposes, like records you keep and report to external agencies, correct time has to be in order.
If this is scientific or research timing between systems, especially logging boxes, is very important. Correct time as defined by an external arbiter is not usually a big deal.
What do you need? Going for a really tiny discrepancy in the drift file is not usually required.
Last edited by jim mcnamara; 12-22-2016 at 01:27 PM..
If you're running ntp for synchronisation, you can use this command:
Resulting in this at my host:
The line with the asterisk is the server selected for synchronisation. The second last value is supposedly what you like to have: Offset from source.
If you do use some other software to synchronize, there will be other commands to get the offset. E. g. for chrony it's chronyc tracking.
A more general way would be using ntpdate -q on your timeserver to display the offset, without actually setting the time.
I am using ntpd service to sync our RHEL 5.9 system to synch with GPS clock.
When I change the RHEL system time more than 7 seconds than the present system time (through "Datetime" command), ntpd service does not adjust the system time to the present GPS time.But if the time is with in 7 seconds,... (6 Replies)
Hi Gurus,
I have a scenario where i need to monitor for a process which starts at a particular time. I need to check if the process has started at the specified time and keep checking this for 5 minutes only and then want to alert me.
ps -ef | grep -i process.sh | grep -v grep >... (5 Replies)
Hey
Excuse me if this question is repeated everywhere but I am still new with scripting and I couldn't apply what I found to my case :confused::confused:
I am trying to run a rec process on a ssh client and at the same time play a file from my computer so i tried this
#!/bin/bash
echo... (3 Replies)
how do i start with this guys?
Sample run:
$ LOGTIME it2015678 <enter>
User it2015678 is CRUZ Tommy H
And has logged on to the system for:
8 hours
12 minutes
from the time this script was run. (1 Reply)
We have number of servers which belongs to platforms Solaris, AIX,HP-UX and LINUX. Monitoring tool 'Patrol Agent' process run on the servers to check for the server health and communicate with the Patrol server through the port 5181. During scheduled reboot and maintenance of servers we do receive... (1 Reply)
Hi All,
I am trying to synchronize two folders(test and test1) using rsync. "test" has some sub folders and all of the have some files also. I just want to sync the directory structure not the files in the first folder with the second. i tried the following script.
rsync -av --include '*/'... (5 Replies)
Hi,
I am new to Unix. I have an application which i need to monitor it for the available system time. If the system is down, i need to send an email notifying the downtime. Can someone provide a sample code or shell script to perform the above activity.
Thanks (3 Replies)
Hi ! I wish extract one information(error code) from the machine which is running on the HP-UX platform. Can anyone help me?
Wanted to write a scripts that monitor real time at the error code and transfer the information out from the machine. The information is then process and SMS out to the... (9 Replies)