Thursday 26 September 2019

How to set time zone in server

My scenario: while install one SAP Business solution, installation stopped due to time zone difference between the Application & DB server.


Here we go for changing the time zone for my Application server:

Step1: check the present time zone of the server.

$date

Thu Sep 26 16:23:24 +07 2019

step2: Navigate to etc/localtime & remove 

$/etc # ll loc*
-rw-r--r-- 1 root root 407 Jan 21  2018 locale.conf
lrwxrwxrwx 1 root root  36 Sep 26 15:54 localtime -> /usr/share/zoneinfo/Indian/Christmas

step3:

$ rm localtime

cross check now:

/etc # ll loc*
-rw-r--r-- 1 root root 407 Jan 21  2018 locale.conf

step4: Select the time zone to be maintained

$ cd /usr/share/zoneinfo/



/usr/share/zoneinfo # ls
Africa      Atlantic   Chile    Eire     Factory  GMT-0      Iceland      Jamaica    Mexico   NZ-CHAT   posixrules  ROK        US            zone.tab
America     Australia  CST6CDT  EST      GB       GMT+0      Indian       Japan      MST      Pacific   PRC         Singapore  UTC           Zulu
Antarctica  Brazil     Cuba     EST5EDT  GB-Eire  Greenwich  Iran         Kwajalein  MST7MDT  Poland    PST8PDT     Turkey     WET
Arctic      Canada     EET      Etc      GMT      Hongkong   iso3166.tab  Libya      Navajo   Portugal  right       UCT        W-SU
Asia        CET        Egypt    Europe   GMT0     HST        Israel       MET        NZ       posix     ROC         Universal  zone1970.tab

Step 5: here i need to set time zone as KUWAIT as per my client server geographical location.

/usr/share/zoneinfo/Asia # ls
Aden       Baghdad  Calcutta    Dili         Hovd       Kashgar       Macao         Omsk        Saigon         Tbilisi        Ulan_Bator
Almaty     Bahrain  Chita       Dubai        Irkutsk    Kathmandu     Macau         Oral        Sakhalin       Tehran         Urumqi
Amman      Baku     Choibalsan  Dushanbe     Istanbul   Katmandu      Magadan       Phnom_Penh  Samarkand      Tel_Aviv       Ust-Nera
Anadyr     Bangkok  Chongqing   Famagusta    Jakarta    Khandyga      Makassar      Pontianak   Seoul          Thimbu         Vientiane
Aqtau      Barnaul  Chungking   Gaza         Jayapura   Kolkata       Manila        Pyongyang   Shanghai       Thimphu        Vladivostok
Aqtobe     Beijing  Colombo     Harbin       Jerusalem  Krasnoyarsk   Muscat        Qatar       Singapore      Tokyo          Yakutsk
Ashgabat   Beirut   Dacca       Hebron       Kabul      Kuala_Lumpur  Nicosia       Qyzylorda   Srednekolymsk  Tomsk          Yangon
Ashkhabad  Bishkek  Damascus    Ho_Chi_Minh  Kamchatka  Kuching       Novokuznetsk  Rangoon     Taipei         Ujung_Pandang  Yekaterinburg
Atyrau     Brunei   Dhaka       Hong_Kong    Karachi    Kuwait        Novosibirsk   Riyadh      Tashkent       Ulaanbaatar    Yerevan

Step 6: Navigate to /etc/again

and execute the below command

/etc # ln -s /usr/share/zoneinfo/Asia/Kuwait localtime

Step 7: verify once

/etc # ll loc*
-rw-r--r-- 1 root root 407 Jan 21  2018 locale.conf
lrwxrwxrwx 1 root root  31 Sep 26 12:39 localtime -> /usr/share/zoneinfo/Asia/Kuwait


$date
Thu Sep 26 12:41:19 +03 2019

No comments:

Post a Comment