date - time
Time synchronization:timed, ntpd, setclock
ntp is considered superior to timed.
ntpd is a daemon that runs to keep your time up to date/time. For this you must configure ntp.conf so it will know where to get the date/time.
ntpdate is a command that will use ntp.conf to do an update now as opposed to waiting for ntpd to do it.
Translation: You want ntpd, you need to configure ntp.conf. You CAN use ntpdate to do manual updates.
should put this line to /etc/ntp.conf:
1. stopsrc -s xntpd
2. ntpdate <ntp server> <--ntpdate command will decline if xntpd is running
4 Oct 14:20:07 ntpdate: step time server 184.108.40.206 offset -32.293912 sec
<<3. smit date>>
4. vi /etc/rc.tcpip
5. uncomment this line: start /usr/sbin/xntpd "$src_running"
6. startsrc -s xntpd
1. lssrc -ls xntpd <--Sys peer should show a valid server or 127.127.1.0.
If the server is "insane":
2. vi /etc/ntp.conf:
Double check that "broadcast client" is commented out.
stopsrc -s xntpd
startsrc -s xntpd
If it is a DB server, use the -x flag to prevent the clock from changing in a negative direction.
Enter the following:startsrc -s xntpd -a "-x"
3. lssrc -ls xntpd <--check if the server is synched. It can take up 12 minutes
1. ntpdate -d ip.address.of.server <--verify there is a suitable server for synch
The offset must be less than 1000 seconds for xntpd to synch.
If the offset is greater than 1000 seconds, change the time manually on the client and run the ntpdate -d again.
If you get the message, "no server suitable for synchronization found", verify xntpd is running on the server (see above) and that no firewalls are blocking port 123.
2. vi /etc/ntp.conf <--specify your xntp server in /etc/ntp.conf, enter:
(Comment out the "broadcastclient" line and add server ip.address.of.server prefer.)
Leave the driftfile and tracefile at their defaults.
3. startsrc -s xntpd <--start the xntpd daemon:
(Use the -x flag if it is appropriate for your environment.)
4. vi /etc/rc.tcpip <--uncomment xntpd from /etc/rc.tcpip so it will start on a reboot.
Uncomment the following line:
start /usr/sbin/xntpd "$src_running"
If using the -x flag, add "-x" to the end of the line. You must include the quotes around the -x.
5. lssrc -ls xntpd <--verify that the client is synched.
Sys peer should display the IP address or name of your xntp server. This process may take up to 12 minutes.
FOR NTP problem:
# ntpq -p
No association ID's returned
It can be checked with this as well:
# ntpq -p <severname>
# tail /etc/ntp.conf
server timeserver.domain.com prefer
# ping timeserver.domain.com
0821-062 ping: host name timeserver.domain.com NOT FOUND
# tail /etc/netsvc.conf
# nslookup timeserver.domain.com
# vi /etc/netsvc.conf
# refresh -s xntpd
# ntpq -p
remote refid st t when poll reach delay offset disp
sys_pmm-1 timeserver2 2 u 24 64 1 13.75 1.279 15875.0
timeserver2 . hopf. 1 u 23 64 3 16.85 -5.670 7875.17
Time Zone variable:
Time Zone variable (TZ) is defined in /etc/environment (echo $TZ), and time zone can be specified in two formats: POSIX and Olson.
It maintains a database for each time zone under the /usr/share/lib/zoneinfo.
# ls -l /usr/share/lib/zoneinfo/Europe
-rw-r--r-- 1 bin bin 2917 Sep 13 2013 Amsterdam
-rw-r--r-- 1 bin bin 1725 Sep 13 2013 Andorra
-rw-r--r-- 1 bin bin 2245 Sep 13 2013 Athens
This format uses known names of cities or regions. We can specify the time zone name in a simple, easy-to-understand format: TZ=America/New_York
The POSIX time zone format is the traditionally used format for AIX systems. The advantage of POSIX is that you can easily and explicitly specify the time zone and daylight saving time (DST) manually.
DST: Daylight Saving Time (this means that we have to change our clock at spring/autumn)
The TZ variable specified in POSIX format contains all information required to identify the time zone, specify when to switch DST on and off, and specify the offset from Coordinated Universal Time (UTC). AIX internally does everything in UTC time, and any display of time to the users is based on the time zone and DST rules specified by TZ variable.
TZ format in POSIX: TZ = local_timezone,date,date
TZ=NFT-1DFT-2,M3.5.0,M10.5.0 <--DST is used
TZ=CUT <--DST is not used
Usually letter "D" means Daylight Saving Time (DST). The US rules have letters "S" for standard and "D" for DST.
For example America/New_York zone format in POSIX looks this way: EST5EDT,M3.2.0,M11.1.0 ("EST" and "EDT" shows these changes in the timezone)
if you see this:
NFT <--name of Standard Time (Oct. -> March)
-1 <--difference between standard time and UTC (or CUT) (it means between Oct. and March our time is behind 1 hour from UTC)
DFT <--name of Daylight Saving Time (March -> Oct.)
-2 <--difference between DST and UTC (or CUT) (it means between March and Oct our time is behind 2 hour from UTC)
Start Daylight Saving Time:
M3 <--month 3 (March)
5 <--5. occurence on that month
Stop Daylight Saving Time:
M10 <--month 10 (October)
5 <--5. occurence on that month
The "CUT0" is actually another POSIX $TZ value, not an Olson name,and it refers to constant UT+0h, with no DST, and constant abbreviation "CUT".
In 'smit chtz_user' 2 terms are used for setting timezones:
Standard Time: time usually used from end of October until end of March
Daylight Saving Time: this is the time usually used from end of March until end of October
grep TZ /etc/environment checking TZ variable (echo $TZ works as well)
tail -1 /usr/share/lib/zoneinfo/Europe/Athens to get some info regarding POSIX abbreviation from an Olson value
zdump Turkey shows actual date at given zone (zdump CET works as well)
zdump -v CET | grep 2015 getting info about DST changing date/time in the given year (idtst=0 means DST is turned off)
smitty chtz_user (smitty chtz_date) or chtz
(here you can see timezone list: ls -l /usr/share/lib/zoneinfo)
chtz EST5EDT <--it will change timezone to EST5EDT
Environment variables are examined when a command starts running. The environment of a process is not changed by altering the /etc/environment file. Any processes that were started prior to the change to the /etc/environment file must be restarted if the change is to take effect for those processes. If the TZ variable is changed, the cron daemon must be restarted, because this variable is used to determine the current local time.
- FS - LVM
- STORAGE - BACKUP
- UPD. - INSTALL