rsync软件 rsync log日志时间与系统时间差8小时问题处理

环境:

用rsync+sersync配置远程实时同步备份,两边配置完成,正常同步。后发现同步日志rsync.log时间比系统时间慢8个小时问题,如下:

系统时间信息:

[root@rsync ]# timedatectl

      Local time: Wed 2020-10-28 14:38:55 CST
  Universal time: Wed 2020-10-28 06:38:55 UTC
        RTC time: Wed 2020-10-28 06:27:57
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

time文件:

[root@rsync 427]# ls -l /etc/localtime 
lrwxrwxrwx. 1 root root 35 Oct 27 17:17 /etc/localtime -> ../usr/share/zoneinfo/Asia/Shanghai

[root@rsync 427]# date
Wed Oct 28 14:39:28 CST 2020

rsynclog日志文件信息:

2020/10/28 03:33:50 [14630] connect from sersync (192.192.101.96)
2020/10/27 19:33:50 [14630] rsync to docshare/ from rsyncuser@sersync (192.192.101.96)
2020/10/27 19:33:50 [14630] receiving file list
2020/10/27 21:02:34 [14630] sent 1906166 bytes  received 157271577 bytes  total size 545619813056
2020/10/28 05:03:50 [15569] connect from sersync (192.192.101.96)
2020/10/27 21:03:50 [15569] rsync to docshare/ from rsyncuser@sersync (192.192.101.96)
2020/10/27 21:03:50 [15569] receiving file list
2020/10/27 22:48:52 [15569] sent 1905998 bytes  received 157271429 bytes  total size 545619813056

解决办法:

修改/etc/profile文件,添加export TZ=‘CST-8'

source  /etc/profile 使修改立即生效。

再查看日志时间rsync.log,显示正常,如下:

2020/10/28 14:32:53 [21159] rsyncd version 3.1.2 starting, listening on port 873
2020/10/28 14:33:07 [21170] connect from sersync (192.192.101.96)
2020/10/28 14:33:07 [21170] rsync to docshare/ from rsyncuser@sersync (192.192.101.96)
2020/10/28 14:33:07 [21170] receiving file list

再次查看timedatectl,发现有告警,不知道有没有影响,待测

[root@rsync 427]# timedatectl
Warning: Ignoring the TZ variable. Reading the system's time zone setting only.

      Local time: Wed 2020-10-28 14:38:55 CST
  Universal time: Wed 2020-10-28 06:38:55 UTC
        RTC time: Wed 2020-10-28 06:27:57
       Time zone: Asia/Shanghai (CST, +0800)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

king_harry

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值