Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Red hat Crontab Time problem

Posted on 2007-11-22
9
Medium Priority
?
3,602 Views
Last Modified: 2013-12-16
I have a Red Hat Server , the problem is that crontab works in a different time that the time of the server.

For exampe date command gives me this :

17:41:02 EET 2007

so I setup a cron to run in 17:42

the cron never runs (I do check the /varlog/cron file).
but If I set the time of the cron with 8 hours difference ( 9:41 ) the cron will acctualy will acctually run at server's time 17:41 ...
The server's time is GMT+2 :


root /usr/share/zoneinfo# ll /etc/localtime
lrwxrwxrwx  1 root root 33 Nov 22 17:23 /etc/localtime -> /usr/share/zoneinfo/Europe/Athens

0
Comment
Question by:MaRiOsGR
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 2

Accepted Solution

by:
terrydavis earned 1000 total points
ID: 20335251
Do you have all the latest patches?  There have been significant changes to how DST and timezones work.
up2date -l
OR
yum check-update
0
 
LVL 7

Expert Comment

by:mzalfres
ID: 20335898
There is some misconfiguration. You have probably set different system timezone (Europe/Athens) and your login timezone (EET = whatever it is :)).

Run
   date
and note it.
Run
   echo $TZ
If there any output, run:
   unset TZ
Then call 'date' command again. Notice difference. If the difference is 8 hours - you are done.

Next will be to find where the TZ variable is set and unset it permanently - probably somewhere in profile files.

0
 
LVL 2

Author Comment

by:MaRiOsGR
ID: 20335920
hello mzalfres

take a look at the commands:

root /# date
Thu Nov 22 21:39:02 EET 2007

root /# echo $TZ


echo $TZ gives me a blank line..no output, what should I do ?
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 3

Expert Comment

by:amirs80
ID: 20337510
can u post the crontab entry
0
 
LVL 2

Author Comment

by:MaRiOsGR
ID: 20338222
ofcourse , but I dont think that whis would help in any way:

21      9      *       *       *       /scripts/marios.sh

this scedule will acctually run at 17:21pm.
0
 
LVL 13

Expert Comment

by:WizRd-Linux
ID: 20370309
I would say the variable $TZ is manually set for root.

At the beginning of your crontab file add the following:

TZ=EET

This should force the crontab to run in the correct timezone.
0
 
LVL 2

Author Comment

by:MaRiOsGR
ID: 20390803
I did as you said:

root /# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
TZ=EET


the problem still remains the same.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 21197999
Forced accept.

Computer101
EE Admin
0

Featured Post

Vim Reference Guide

Vim is a powerful text editor favored by many sysadmins and developers - here are some commands that you'll want to keep in your back pocket!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question