Sync Solaris System Clock With PDC Using Cron


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sync Solaris System Clock With PDC Using Cron
# 1  
Old 01-18-2010
Sync Solaris System Clock With PDC Using Cron

Hi,

I currently use the ntpdate and date command to sync the internal clock source of my Solaris systems to the primary domain controller.


Code:
 
admin@myserver # ntpdate -d -u 192.168.???.???
14 Jan 17:42:02 ntpdate[929]: ntpdate 3-5.93e+sun 03/06/05 23:16:45 (1.4)
transmit(192.168.???.???)
receive(192.168.???.???)
transmit(192.168.???.???)
receive(192.168.???.???)
transmit(192.168.???.???)
receive(192.168.???.???)
transmit(192.168.???.???)
receive(192.168.???.???)
transmit(192.168.43.1)
server 192.168.???.???, port 123
stratum 1, precision -6, leap 00, trust 000
refid [LOCL], delay 0.04144, dispersion 0.00035
transmitted 4, in filter 4
reference time:    cef8b7b1.ac10624d  Thu, Jan 14 2010  7:20:49.672
originate timestamp: cef9493b.f4000000  Thu, Jan 14 2010 17:41:47.953
transmit timestamp:  cef9494a.90dee000  Thu, Jan 14 2010 17:42:02.565
filter delay:  0.04189  0.04146  0.04144  0.04146
                   0.00000  0.00000  0.00000  0.00000
filter offset: -14.6115 -14.6121 -14.6125 -14.6128
                   0.000000 0.000000 0.000000 0.000000
delay 0.04144, dispersion 0.00035
offset -14.612542
14 Jan 17:42:02 ntpdate[929]: step time server 192.168.???.??? offset -14.612542 sec


I then take the output of the offset and use the following to slowly sync

Code:
date -a -14.612542

Is it possible to run a .sh executable script that would combine both commands and take the offset value of the ntpdate command and automatically insert the value into the date -a command. I would then like to run in a cron.

Thanks in advance
# 2  
Old 01-18-2010
Run the ntpdate command and grep for offset and store it in a variable and then pass on the value of variable to date command

Code:
DATE=`ntpdate -d -u 192.168.???.??? | grep offset`
date -a $DATE

# 3  
Old 01-18-2010
Why not just install an NTP daemon that will continuously synch your clock?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Xt timer call, XtAppAddTimeout, hangs on system clock jump backwards

Hi, I've got an issue which I've been 'google-fu'ing without much luck. We have a legacy program which has been plagued by an issue for a long time and I've been tasked to investigate/fix. The program uses XMotif2.1 (required due to dependency on an old GUI designer) and runs on a RHEL7... (4 Replies)
Discussion started by: altrefrain
4 Replies

2. Shell Programming and Scripting

cron: Clock generating

Hello. I would like to do this : A_VAR_FLAG = "ABCD" +------------+...................................+---------+ ...............................|.................|...................................|.............|... (7 Replies)
Discussion started by: jcdole
7 Replies

3. SCO

System Clock running at half speed

SCO Openserver 6.0.0 had an issue with a NIC losing it's config on reboot. Netconfig would not allow "view protocol" and apparently zeroed out the existing IP info. Repaired from console. After this event, however, the system clock seems to lose 30 seconds for every RTC minute that passes. As a... (1 Reply)
Discussion started by: DoublePanic
1 Replies

4. Solaris

Solaris as PDC

Just wondering: Is it wise to have two OSOL boxes with one being a cifs kernel server and the other one a genuine samba & LDAP to serve as a PDC for the windows clients in the network? (5 Replies)
Discussion started by: PatrickBaer
5 Replies

5. Solaris

NTP time sync in Solaris 10

Ok, I have 4 production systems. There is one NTP server for all four systems. In each system there is one Solaris 10 box that points to that NTP server. All of the other machines in the system point to the Solaris 10 machine to get their time sync. All four Solaris 10 machines have essentially... (2 Replies)
Discussion started by: DeCoTwc
2 Replies

6. Solaris

R-sync for solaris?

Hi Gurus I ave a Prod,standby and DR server(All Sol 5.9) and i need to sync the Application running in prod,standby and DR. The Application vests in a filesystem(a directory) and syncing the directory would server my purpose. I came across rsync utility and am planning to implement it. But... (3 Replies)
Discussion started by: Hari_Ganesh
3 Replies

7. AIX

Sync AIX system time with Windows Domain Controller

Yeah so, I have setup a domain controller (windows 2003) active directory machine and it is managing couple of windows servers and workstation. I also have couple of AIX machines that need to have the same time as other windows server and workstation hanging off of that domain controller. Now... (1 Reply)
Discussion started by: murderfly
1 Replies

8. AIX

AIX 5.3 12 Hour System Clock

Hello Everyone, I have a Domino application running on AIX 5.3 that does time conversions worldwide. It uses the operating system time as a reference for the conversion. My problem is that I need the AIX OS clock to be a 12 hour clock (AM/PM) rather than a 24 hour clock. I have tried the date... (2 Replies)
Discussion started by: RTwitchell
2 Replies

9. Solaris

How do I sync passwords between Samba and Solaris?

Hi, everyone. I have recently installed Samba version 3.0.23d on my Solaris 10 box. I am attempting to sync Samba's passwords with the UNIX passwords on the system. I read about using a pam module that is included with the samba tar called pam_smbpass.so. The instructions say to issue the make... (0 Replies)
Discussion started by: lazytech
0 Replies

10. Solaris

cron sync

hi all , i have a E4900 server cluster that consists of 2 Servers (Cluster1 and cluster2 ) all of my crons are located under /var/spool/cron/crontabs . I am trying to put them on a shared place , so thati dont have to edit both crons on every system . thank you cheers (3 Replies)
Discussion started by: ppass
3 Replies
Login or Register to Ask a Question

Featured Tech Videos