We got problem in Centos 6 server with plesk panel,
Timezone got reset frequently on one that server, I've found the issue on update of tzdata package, Working on it to find permanent solution, But in mean time I've used following script for reset timezone.
Timezone got reset frequently on one that server, I've found the issue on update of tzdata package, Working on it to find permanent solution, But in mean time I've used following script for reset timezone.
# /bin/shChange your timezone what you need, I'm using IST and using log file to know status. Even we can use mail function on it.
TZ=`date '+%Z'`
CTIME=` date '+%Y/%m/%d'-'%T'`
if [[ "$TZ" != IST ]] ; then
touch /var/log/timezone-script.log
echo "["$CTIME"]" "Current time-zone is" $TZ "and Needs to change" >> /var/log/timezone-script.log
rm -f /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Kolkata /etc/localtime
else
echo "["$CTIME"]" "Current time-zone is" $TZ "and Working fine" >> /var/log/timezone-script.log
fi
Default location of timezone is /usr/share/zoneinfo/
No comments:
Post a Comment