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.
Your current timezone is GMT, why did you set
/etc/timezone
to "+0800"?perldoc Date::Manip
Which
Date::Manip
version are you running?If for some reasons, Perl doesn't read
/etc/timezone
or/etc/TIMEZONE
, you can add this line into/root/.bash_profile
:Make it takes effect immediately by running
source /root/.bash_profile
and try again.UPDATE Thu Aug 30 10:55:54 ICT 2012
Try setting the timezone in your logwatch perl script:
Actually this worked
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.