Cannot run logwatch due to Date::Manip issue

Quintin Par asked:

I tried to run logwatch at follows

[root@machine cron.daily]# ./0logwatch 
ERROR: Date::Manip unable to determine TimeZone.

Execute the following command in a shell prompt:
        perldoc Date::Manip
The section titled TIMEZONES describes valid TimeZones
and where they can be defined.

My date is as follows

root@machine cron.daily]# date
Thu Aug 23 06:25:21 GMT 2012

Now based on details in various forums I tried to fix this by setting

/etc/timezone to “+0800”

but it didn’t work

My /etc/localtime points to /usr/share/zoneinfo/GMT and is managed by puppet

How do I go about fixing this? I still want all my machines to be in GMT timezone.

EDIT:
Sadly,
Both the changes are not working:

[root@machine cron.daily]# cat /etc/TIMEZONE 
UTC

Quanta’s

[root@machine cron.daily]# cat ~/.bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin
export TZ=GMT

export PATH
[root@machine cron.daily]# source ~/.bash_profile
[root@machine cron.daily]# ./0logwatch 
ERROR: Date::Manip unable to determine TimeZone.

Execute the following command in a shell prompt:
        perldoc Date::Manip
The section titled TIMEZONES describes valid TimeZones
and where they can be defined.

My answer:


That’s not a fix, it’s a workaround. But it should get you going.

The reason it didn’t work is that it’s expecting TIMEZONE to be capitalized.

echo UTC > /etc/TIMEZONE

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.