Acerto Horario de Verao

5
Verificar qual o localtime [root@landrover ~]# ls -la /etc/localtime lrwxrwxrwx 1 root root 37 Out 19 09:58 /etc/localtime -> /usr/share/zoneinfo/America/Sao_Paulo Caso a saida seja algo como o mostrado abaixo [root@landrover ~]# ls -la /etc/localtime -rw-r--r-- 1 root root 2001 Out 19 09:58 /etc/localtime Devemos corrigir, copiando o /etc/localtime para /etc/localtime-old deletar o arquivo /etc/localtime e em seguida criar um link como mostrado abaixo [root@landrover ~]# ln -s /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime O Arquivo Sao_Paulo.zic alterado para o horário de verão : # HORARIO DE VERAO BRASILEIRO Rule BrazilSP 2012 only - Oct 21 0:00 1:00 S Rule BrazilSP 2013 only - Feb 17 0:00 0 - Rule BrazilSP 2013 only - Oct 20 0:00 1:00 S Rule BrazilSP 2014 only - Feb 16 0:00 0 - Rule BrazilSP 2014 only - Oct 19 0:00 1:00 S Rule BrazilSP 2015 only - Feb 22 0:00 0 - Rule BrazilSP 2015 only - Oct 18 0:00 1:00 S Rule BrazilSP 2016 only - Feb 21 0:00 0 - Rule BrazilSP 2016 only - Oct 16 0:00 1:00 S Rule BrazilSP 2017 only - Feb 19 0:00 0 - Rule BrazilSP 2017 only - Oct 22 0:00 1:00 S Rule BrazilSP 2018 only - Feb 18 0:00 0 - Rule BrazilSP 2018 only - Oct 21 0:00 1:00 S # Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL] Zone America/Sao_Paulo -3:00 BrazilSP BR%sT O arquivo Sao_Paulo.zic deve ser criado no diretório root com o conteudo acima, em seguida devemos executar o comando zic Sao_Paulo.zic. Verificando o que foi feito : [root@landrover ~]# zdump -v America/Sao_Paulo America/Sao_Paulo -9223372036854775808 = NULL America/Sao_Paulo -9223372036854689408 = NULL America/Sao_Paulo Sun Oct 21 02:59:59 2012 UTC = Sat Oct 20 23:59:59 2012 BRT isdst=0 gmtoff=-10800 America/Sao_Paulo Sun Oct 21 03:00:00 2012 UTC = Sun Oct 21 01:00:00 2012 BRST isdst=1 gmtoff=-7200 America/Sao_Paulo Sun Feb 17 01:59:59 2013 UTC = Sat Feb 16 23:59:59 2013 BRST isdst=1 gmtoff=-7200 America/Sao_Paulo Sun Feb 17 02:00:00 2013 UTC = Sat Feb 16 23:00:00 2013 BRT isdst=0 gmtoff=-10800 America/Sao_Paulo Sun Oct 20 02:59:59 2013 UTC = Sat Oct 19 23:59:59 2013 BRT isdst=0 gmtoff=-10800 America/Sao_Paulo Sun Oct 20 03:00:00 2013 UTC = Sun Oct 20 01:00:00 2013 BRST isdst=1 gmtoff=-7200 America/Sao_Paulo Sun Feb 16 01:59:59 2014 UTC = Sat Feb 15 23:59:59 2014 BRST isdst=1 gmtoff=-7200 America/Sao_Paulo Sun Feb 16 02:00:00 2014 UTC = Sat Feb 15 23:00:00 2014 BRT isdst=0 gmtoff=-10800 America/Sao_Paulo Sun Oct 19 02:59:59 2014 UTC = Sat Oct 18 23:59:59 2014 BRT isdst=0 gmtoff=-10800 America/Sao_Paulo Sun Oct 19 03:00:00 2014 UTC = Sun Oct 19 01:00:00 2014 BRST isdst=1 gmtoff=-7200 America/Sao_Paulo Sun Feb 22 01:59:59 2015 UTC = Sat Feb 21 23:59:59 2015 BRST isdst=1 gmtoff=-7200 America/Sao_Paulo Sun Feb 22 02:00:00 2015 UTC = Sat Feb 21 23:00:00 2015 BRT isdst=0 gmtoff=-10800 America/Sao_Paulo Sun Oct 18 02:59:59 2015 UTC = Sat Oct 17 23:59:59 2015 BRT isdst=0 gmtoff=-10800 America/Sao_Paulo Sun Oct 18 03:00:00 2015 UTC = Sun Oct 18 01:00:00 2015 BRST isdst=1 gmtoff=-7200 America/Sao_Paulo Sun Feb 21 01:59:59 2016 UTC = Sat Feb 20 23:59:59 2016 BRST isdst=1 gmtoff=-7200 America/Sao_Paulo Sun Feb 21 02:00:00 2016 UTC = Sat Feb 20 23:00:00 2016 BRT isdst=0 gmtoff=-10800 America/Sao_Paulo Sun Oct 16 02:59:59 2016 UTC = Sat Oct 15 23:59:59 2016 BRT isdst=0 gmtoff=-10800 America/Sao_Paulo Sun Oct 16 03:00:00 2016 UTC = Sun Oct 16 01:00:00 2016 BRST isdst=1 gmtoff=-7200 America/Sao_Paulo Sun Feb 19 01:59:59 2017 UTC = Sat Feb 18 23:59:59 2017 BRST isdst=1 gmtoff=-7200 America/Sao_Paulo Sun Feb 19 02:00:00 2017 UTC = Sat Feb 18 23:00:00 2017 BRT isdst=0 gmtoff=-10800 America/Sao_Paulo Sun Oct 22 02:59:59 2017 UTC = Sat Oct 21 23:59:59 2017 BRT isdst=0 gmtoff=-10800 America/Sao_Paulo Sun Oct 22 03:00:00 2017 UTC = Sun Oct 22 01:00:00 2017 BRST isdst=1 gmtoff=-7200

description

Horario de Verão no Linux ( CentOS/Fedora/Redhat )

Transcript of Acerto Horario de Verao

Page 1: Acerto Horario de Verao

Verificar qual o localtime

[root@landrover ~]# ls -la /etc/localtimelrwxrwxrwx 1 root root 37 Out 19 09:58 /etc/localtime -> /usr/share/zoneinfo/America/Sao_Paulo

Caso a saida seja algo como o mostrado abaixo

[root@landrover ~]# ls -la /etc/localtime-rw-r--r-- 1 root root 2001 Out 19 09:58 /etc/localtime

Devemos corrigir, copiando o /etc/localtime para /etc/localtime-old deletar o arquivo /etc/localtime e em seguida criar um link como mostrado abaixo

[root@landrover ~]# ln -s /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime

O Arquivo Sao_Paulo.zic alterado para o horário de verão :

# HORARIO DE VERAO BRASILEIRO Rule BrazilSP 2012 only - Oct 21 0:00 1:00 SRule BrazilSP 2013 only - Feb 17 0:00 0 - Rule BrazilSP 2013 only - Oct 20 0:00 1:00 SRule BrazilSP 2014 only - Feb 16 0:00 0 - Rule BrazilSP 2014 only - Oct 19 0:00 1:00 SRule BrazilSP 2015 only - Feb 22 0:00 0 - Rule BrazilSP 2015 only - Oct 18 0:00 1:00 SRule BrazilSP 2016 only - Feb 21 0:00 0 - Rule BrazilSP 2016 only - Oct 16 0:00 1:00 SRule BrazilSP 2017 only - Feb 19 0:00 0 - Rule BrazilSP 2017 only - Oct 22 0:00 1:00 SRule BrazilSP 2018 only - Feb 18 0:00 0 - Rule BrazilSP 2018 only - Oct 21 0:00 1:00 S# Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL]Zone America/Sao_Paulo -3:00 BrazilSP BR%sT

O arquivo Sao_Paulo.zic deve ser criado no diretório root com o conteudo acima, em seguida devemos executar o comando zic Sao_Paulo.zic.

Verificando o que foi feito : [root@landrover ~]# zdump -v America/Sao_PauloAmerica/Sao_Paulo -9223372036854775808 = NULLAmerica/Sao_Paulo -9223372036854689408 = NULLAmerica/Sao_Paulo Sun Oct 21 02:59:59 2012 UTC = Sat Oct 20 23:59:59 2012 BRT isdst=0 gmtoff=-10800America/Sao_Paulo Sun Oct 21 03:00:00 2012 UTC = Sun Oct 21 01:00:00 2012 BRST isdst=1 gmtoff=-7200America/Sao_Paulo Sun Feb 17 01:59:59 2013 UTC = Sat Feb 16 23:59:59 2013 BRST isdst=1 gmtoff=-7200America/Sao_Paulo Sun Feb 17 02:00:00 2013 UTC = Sat Feb 16 23:00:00 2013 BRT isdst=0 gmtoff=-10800America/Sao_Paulo Sun Oct 20 02:59:59 2013 UTC = Sat Oct 19 23:59:59 2013 BRT isdst=0 gmtoff=-10800America/Sao_Paulo Sun Oct 20 03:00:00 2013 UTC = Sun Oct 20 01:00:00 2013 BRST isdst=1 gmtoff=-7200America/Sao_Paulo Sun Feb 16 01:59:59 2014 UTC = Sat Feb 15 23:59:59 2014 BRST isdst=1 gmtoff=-7200America/Sao_Paulo Sun Feb 16 02:00:00 2014 UTC = Sat Feb 15 23:00:00 2014 BRT isdst=0 gmtoff=-10800America/Sao_Paulo Sun Oct 19 02:59:59 2014 UTC = Sat Oct 18 23:59:59 2014 BRT isdst=0 gmtoff=-10800America/Sao_Paulo Sun Oct 19 03:00:00 2014 UTC = Sun Oct 19 01:00:00 2014 BRST isdst=1 gmtoff=-7200America/Sao_Paulo Sun Feb 22 01:59:59 2015 UTC = Sat Feb 21 23:59:59 2015 BRST isdst=1 gmtoff=-7200America/Sao_Paulo Sun Feb 22 02:00:00 2015 UTC = Sat Feb 21 23:00:00 2015 BRT isdst=0 gmtoff=-10800America/Sao_Paulo Sun Oct 18 02:59:59 2015 UTC = Sat Oct 17 23:59:59 2015 BRT isdst=0 gmtoff=-10800America/Sao_Paulo Sun Oct 18 03:00:00 2015 UTC = Sun Oct 18 01:00:00 2015 BRST isdst=1 gmtoff=-7200America/Sao_Paulo Sun Feb 21 01:59:59 2016 UTC = Sat Feb 20 23:59:59 2016 BRST isdst=1 gmtoff=-7200America/Sao_Paulo Sun Feb 21 02:00:00 2016 UTC = Sat Feb 20 23:00:00 2016 BRT isdst=0 gmtoff=-10800America/Sao_Paulo Sun Oct 16 02:59:59 2016 UTC = Sat Oct 15 23:59:59 2016 BRT isdst=0 gmtoff=-10800America/Sao_Paulo Sun Oct 16 03:00:00 2016 UTC = Sun Oct 16 01:00:00 2016 BRST isdst=1 gmtoff=-7200America/Sao_Paulo Sun Feb 19 01:59:59 2017 UTC = Sat Feb 18 23:59:59 2017 BRST isdst=1 gmtoff=-7200America/Sao_Paulo Sun Feb 19 02:00:00 2017 UTC = Sat Feb 18 23:00:00 2017 BRT isdst=0 gmtoff=-10800America/Sao_Paulo Sun Oct 22 02:59:59 2017 UTC = Sat Oct 21 23:59:59 2017 BRT isdst=0 gmtoff=-10800America/Sao_Paulo Sun Oct 22 03:00:00 2017 UTC = Sun Oct 22 01:00:00 2017 BRST isdst=1 gmtoff=-7200

Page 2: Acerto Horario de Verao

America/Sao_Paulo Sun Feb 18 01:59:59 2018 UTC = Sat Feb 17 23:59:59 2018 BRST isdst=1 gmtoff=-7200America/Sao_Paulo Sun Feb 18 02:00:00 2018 UTC = Sat Feb 17 23:00:00 2018 BRT isdst=0 gmtoff=-10800America/Sao_Paulo Sun Oct 21 02:59:59 2018 UTC = Sat Oct 20 23:59:59 2018 BRT isdst=0 gmtoff=-10800America/Sao_Paulo Sun Oct 21 03:00:00 2018 UTC = Sun Oct 21 01:00:00 2018 BRST isdst=1 gmtoff=-7200America/Sao_Paulo 9223372036854689407 = NULLAmerica/Sao_Paulo 9223372036854775807 = NULL

Verificando com o comando date[root@landrover ~]# dateFri Oct 19 10:54:16 BRT 2012

[root@landrover ~]# dateFri Oct 20 11:54:16 BRST 2012

Siglas importantes na saida do comando date :

Sigla Descrição

BRT Brasil Time ( Horario normal )

BRST Brasil Save Time ( Horário de Verão )

GMT Greenwich Mean Time

UTC Universal Coordinated Time

Verificando a hora da BIOS

[root@honda ~]# clock --localtimeFri 19 Oct 2012 12:18:52 PM BRT -0.378916 seconds

[root@azera etc]# dateFri Oct 19 11:31:44 BRT 2012[root@azera etc]# clock --showFri 19 Oct 2012 11:31:49 AM BRT -0.777284 seconds

[root@aston ~]# dateSex Out 19 14:49:32 GMT 2012……[root@aston ~]# dateSex Out 19 11:56:07 BRT 2012

# Hora 16:14[root@citroen ~]# date Sex Out 19 16:55:56 BRT 2012 [root@citroen ~]# clock --show Sex 19 Out 2012 16:58:56 BRT -0.526191 segundos

Configurando Servidor de Hora

Primeiramente devemos nos certificar de ter instalado o pacote ntp, system-config-date[root@tracker ~]# rpm -qa |grep ntpchkfontpath-1.10.1-1.1ntp-4.2.2p1-8.el5.centos.1[root@tracker ~]# rpm -qa |grep system-config-datesystem-config-date-1.8.12-3.el5.centos.2

Page 3: Acerto Horario de Verao

[root@tracker ~]#

Caso algum destes pacotes não estiverme instalados, providenciar a instalação e só proceguir com estes pacotes instalados.Se os pacotes já estiverem instalados, podemos executar o utilitário de configuração system-config-date, como mostrado abaixo.

Devemos clicar na aba Network Time Protocol, remover os servidores que estiverem cadastrados e adicionar o ntp.wheatonbrasil.com.br, como mostrado na figura abaixo.

Page 4: Acerto Horario de Verao

Após clicar em OK, a hora do sistema deve ser sincronizada com o servidor de hora indicado, perceba que a ultima linha da imagem abaixo informa que o arquivo /usr/share/zoneinfo/America/Sao_Paulo e o arquivo /etc/localtime são o mesmo arquivo.

Esta mensagem deve aparecer quando o procedimento de horario de verão já estiver feito.

Page 5: Acerto Horario de Verao

Servidores configurados

acura A 10.1.1.15focus A 10.0.1.2 spirit A 10.0.1.3landrover A 192.168.0.198astra A 192.168.0.16 hilux A 10.0.1.31 genesis A 10.0.1.11 aston A 10.1.1.64azera A 10.1.1.47agile A 192.168.0.27cherokee A 10.1.1.24chevelle-ss A 10.1.1.42chevette A 10.1.1.38galaxie A 10.1.1.100honda A 10.1.1.49newcivic A 10.1.1.43porsche A 10.1.1.4thunderbird A 10.1.1.45tracker A 10.1.1.26captiva A 10.1.1.11bmw A 10.1.1.59caravan A 10.1.1.62citroen A 10.1.1.46classic A 10.1.1.27cobalt A 10.1.1.30crossfox A 10.1.1.61fielder A 10.1.1.66ged A 10.1.1.100logan A 10.1.1.65gol A 10.1.1.63jaguar A 10.1.1.28lancer A 10.1.1.16santafe A 10.1.1.57landau A 10.1.1.44mclaren A 10.1.1.12punto A 10.1.1.67omega A 10.1.1.36uno A 10.1.1.17lexus A 192.168.0.11xsara A 192.168.0.2

OBS: O servidor Newcivic esta atrazado em 10 minutos.

Procedimento para parar o tomcat cd /opt/tomcatcd bin./catalina.sh stop

Procedomento para iniciar o tomcatcd /opt/tomcatcd bin./catalina start