Sponsored Content
Full Discussion: Script to detect time drift
Operating Systems HP-UX Script to detect time drift Post 303018986 by MadeInGermany on Wednesday 20th of June 2018 03:13:34 PM
Old 06-20-2018
Looks like the "ntpq -c rl" changes with every update of the NTP package.
Take the "ntpq -pn" output instead! To be processed like this in the shell script:
Code:
offset=$(
ntpq -pn | awk '/^[*]/ {print $9}'
)

This User Gave Thanks to MadeInGermany For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to detect my script is already running

I have a script which must not be run more than once at any given time. THis script will be scheduled to run every 20 mins as a cron job. In my script can i have logic to say if this script is already running from the previous cron, then exit. How do i go about doing that. If you describe the... (11 Replies)
Discussion started by: rmulchandani
11 Replies

2. Shell Programming and Scripting

AWK script to detect webpages from file

Hi guys I'm very new to unix and I have to create an awk script that detects webpage addresses from a file/webpage and outputs how many times each webpage was detected.e.g. if my file was: (Note: The symbol " was added to stop them being created into links) "www.google.com"... (1 Reply)
Discussion started by: ROFL
1 Replies

3. Shell Programming and Scripting

AWK script to detect webpages from file

Hi guys I'm very new to unix and I have to create an awk script that detects webpage addresses from a file/webpage and outputs how many times each webpage was detected.e.g. if my file was: www.google.com www.facebook.com www.google.com the output should be: www.google.com x2... (2 Replies)
Discussion started by: ROFL
2 Replies

4. Shell Programming and Scripting

Detect if script starts from queue

Dear community, what I'm try to do is deny users to run a script without parameters from command bash, but the same script should run without parameters only from crontab. Example runs by crontab:*/5 * * * * /tmp/script.sh Here the normal execution starts every 5 minutes Example #1 runs by... (16 Replies)
Discussion started by: Lord Spectre
16 Replies

5. Shell Programming and Scripting

How to detect Hanged process in shell script?

I have to check daily 20 processes each day. The names are like Network1 Network2 Network3 ....... Network20. There is built in utility for doing this. Following is the command to check a single network process. check_process_status 1 If we want to check the status of Network2 then the... (6 Replies)
Discussion started by: Nakul_sh
6 Replies

6. Shell Programming and Scripting

Help with detect with regex and move script

Hi all, I am needing some help with a script that will search for a video file by known extensions and then do a pattern search (I'm guessing via regex) and then based on a match of one type of another move the file to an assigned directory. I would like to do this with either a shell script... (7 Replies)
Discussion started by: Simplify
7 Replies

7. UNIX for Advanced & Expert Users

A script to detect system type

Hi forum, So I am trying to determine the OS type with the following script: #!/usr/bin/sh OStype1=`uname -s` Sunos1=SunOs if then echo "This system is Linux" exit 0 elif then echo "This system is SunOs" exit 0 elif (1 Reply)
Discussion started by: dampio
1 Replies

8. UNIX for Beginners Questions & Answers

Script to detect time drift on server

Hello there, I am not an expert in networking related stuff but I got a requirement to create UNIX script to query our Company's internal time source via NTP for time drift detect and report it when > +/- 50ms. I have been googling a lot but thought to post it in this forum to get a... (1 Reply)
Discussion started by: Green_Star
1 Replies

9. Shell Programming and Scripting

How to detect url in use in a script?

Hello, I have a small script and it runs from web application in below format: pipe:///path_to_myscript.sh url1 url2 url3 myscript.sh: #!/bin/bash count=0 while do count=$((count+1)) exec 3>&1 ((ffmpeg -i $1 ...... -f mpegts pipe:1 2>/dev/null 1>&3 ) 2>&1 | \ while read LINE; do echo... (9 Replies)
Discussion started by: baris35
9 Replies
NTPDC(8)							Programmer's Manual							  NTPDC(8)

NAME
ntpdc - vendor-specific NTP query program SYNOPSIS
ntpdc [-flag [value]]... [--opt-name [[=| ]value]]... [ host ...] DESCRIPTION
This manual page briefly documents the ntpdc command. The [= prog-name =] utility program is used to query an NTP daemon about its current state and to request changes in that state. It uses NTP mode 7 control message formats described in the source code. The program may be run either in interactive mode or controlled using command line arguments. Extensive state and statistics information is available through the [= prog-name =] interface. In addition, nearly all the configuration options which can be specified at startup using ntpd's configura- tion file may also be specified at run time using [= prog-name =] . OPTIONS
-4, --ipv4 Force IPv4 DNS name resolution. This option must not appear in combination with any of the following options: ipv6. Force DNS resolution of following host names on the command line to the IPv4 namespace. -6, --ipv6 Force IPv6 DNS name resolution. This option must not appear in combination with any of the following options: ipv4. Force DNS resolution of following host names on the command line to the IPv6 namespace. -c cmd, --command=cmd run a command and exit. This option may appear an unlimited number of times. The following argument is interpreted as an interactive format command and is added to the list of commands to be executed on the specified host(s). -l, --listpeers Print a list of the peers. This option must not appear in combination with any of the following options: command. Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the 'listpeers' interactive command. -p, --peers Print a list of the peers. This option must not appear in combination with any of the following options: command. Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the 'peers' interactive command. -s, --showpeers Show a list of the peers. This option must not appear in combination with any of the following options: command. Print a list of the peers known to the server as well as a summary of their state. This is equivalent to the 'dmpeers' interactive command. -i, --interactive Force ntpq to operate in interactive mode. This option must not appear in combination with any of the following options: command, listpeers, peers, showpeers. Force ntpq to operate in interactive mode. Prompts will be written to the standard output and commands read from the standard input. -d, --debug-level Increase output debug message level. This option may appear an unlimited number of times. Increase the debugging message output level. -D string, --set-debug-level=string Set the output debug message level. This option may appear an unlimited number of times. Set the output debugging level. Can be supplied multiple times, but each overrides the previous value(s). -n, --numeric numeric host addresses. Output all host addresses in dotted-quad numeric format rather than converting to the canonical host names. -?, --help Display extended usage information and exit. -!, --more-help Extended usage information passed thru pager. -> [rcfile], --save-opts[=rcfile] Save the option state to rcfile. The default is the last configuration file listed in the OPTION PRESETS section, below. -< rcfile, --load-opts=rcfile, --no-load-opts Load options from rcfile. The no-load-opts form will disable the loading of earlier RC/INI files. --no-load-opts is handled early, out of order. - [{v|c|n}], --version[={v|c|n}] Output version of program and exit. The default mode is `v', a simple version. The `c' mode will print copyright information and `n' will print the full copyright notice. OPTION PRESETS
Any option that is not marked as not presettable may be preset by loading values from configuration ("RC" or ".INI") file(s) and values from environment variables named: NTPDC_<option-name> or NTPDC The environmental presets take precedence (are processed later than) the configuration files. The homerc files are "$HOME", and ".". If any of these are directories, then the file .ntprc is searched for within those directories. AUTHOR
David L. Mills and/or others Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org see html/copyright.html This manual page was AutoGen-erated from the ntpdc option definitions. ( 4.2.6p5) 2011-12-24 NTPDC(8)
All times are GMT -4. The time now is 06:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy