How to set crontab for different Time Zone


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to set crontab for different Time Zone
# 1  
Old 07-27-2010
Error How to set crontab for different Time Zone

Hi,

I want to set cron job for different time zone from my machine. So here is what I did to set it.

I am having a file cronfile, which I use to set cron jobs by using
Code:
  Crontab cronfile

Now in cronfile I set TZ variable as
Set TZ=Asia/Calcutta

But now when I set cron job I am getting following error:

Cronfile:1 : bad minute
Errors in crontab file , can’t install.

Is there any other way to set cron for different time zone.

Thanks,
Sarbjit
# 2  
Old 07-27-2010
search on google how to set cronjob

Crontab – Quick Reference
# 3  
Old 07-27-2010
You will need to change the timezone on a job-by-job basis.
The TZ line should not be a line on its own in crontab, but it can be part of a normal line in crontab or be inside a script.

Quote:
Set TZ=Asia/Calcutta
The syntax you show for TZ is incorrect.
What do you get in a normal interactive session for:
Code:
echo "${TZ}"

What Operating System and version are you running?
What Shell are you running?
Is your server clock set in UTC with default timezone in /etc/TIMEZONE ?


It is often easier to use the cron on a server which runs in the target timezone to trigger jobs on the server which is in a different timezone.
# 4  
Old 07-27-2010
Quote:
Set TZ=Asia/Calcutta
Calcutta is also wrong. It should be either
Quote:
TZ=Asia/Kolkata; export TZ
or
Quote:
setenv TZ Asia/Kolkata
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Global Zone getting crontab info from zone

Hi, First post. I have a script that I am having a little trouble with and I hope someone can help. I will post the code for your input, but I want to read the lines of a file and use this as input to a command in a while loop... #!/bin/sh # # ### Variables MSG=/tmp/tmptest.txt... (7 Replies)
Discussion started by: dakelly
7 Replies

2. UNIX for Dummies Questions & Answers

Crontab in Solaris zone

Hi, I created some cron entries in one of the 4 zones in Solaris 10. Now I want to edit it and unable to find the crontab file crontab -l gives : unable to open crontab file /usr/spool/cron/crontabs doesn't have the crontab file Hence, I did ifconfig -a and tried to login with the 3... (2 Replies)
Discussion started by: Rossdba
2 Replies

3. Shell Programming and Scripting

Convert UTC time into current UNIX sever time zone

Hi guys thanks for the help for my previous posts.Now i have a requirement that i download a XMl file which has UTC time stamp.I need to convert UTC time into Unix server timezone. For ex if the time zone of unix server is CDT then i need to convert into CDT.whatever may be the system time... (5 Replies)
Discussion started by: mohanalakshmi
5 Replies

4. Solaris

Can you set the MAC address in a zone

Hello, On our Solaris 10 servers we have shared NIC interfaces. We have a program that is having issues talking to the all zones because they have the same MAC address. Is there a way with zonecfg or ifconfig to change the MAC on the zones? Other wise we need to rewire the servers and I don't... (4 Replies)
Discussion started by: bitlord
4 Replies

5. Solaris

showing 2 different time zones in global zone and nonglobal zone

can some one help me out as it is showing 2 different time zones in global zone and nonglobal zone .In global zone it is showing in GMT while in nonglobal zone i it showing as PDT. System in running with solaris 10 (3 Replies)
Discussion started by: ravijanjanam12
3 Replies

6. Solaris

modifying date and time and time zone on solaris 5.10 with (redundant server) veritas

I have a cluster of two Solaris server (veritas cluster). one working and the other is standby I am going to change the date on them , and am looking for a secure solution as it is giving an important service. my opinion is that the active one doesn't need to be restarted (if I don't change the... (1 Reply)
Discussion started by: barry1946
1 Replies

7. AIX

Time Zone for a User Different From Server Time

Hi, A server runs on EDT. Can I set a user with time-zone GMT without changing the server time? regards, Roshni (1 Reply)
Discussion started by: RoshniMehta
1 Replies

8. Solaris

set dir in zone fs type

Hi all, what is the meaning and what all value we can pass to set dir= in zone fs type when we are configuring whole-root zone? Thanks (3 Replies)
Discussion started by: kumarmani
3 Replies

9. Shell Programming and Scripting

Compare Last Modified Time across Time Zone

Hi, I'm new to shell script programming, I only have Java programming background. I'm writing a shell script to do file synchronization between 2 machines that located at different time zone area. Both machine were set its time zone according to its geographical location (Eg: server is at... (1 Reply)
Discussion started by: python
1 Replies

10. UNIX for Advanced & Expert Users

how to set passward for solaris zone?

hi , how i can set passward for solaris zone.. thanks (2 Replies)
Discussion started by: tahir23
2 Replies
Login or Register to Ask a Question