06-26-2009
ls -l /etc/TIMEZONE
lrwxrwxrwx 1 root root 14 Apr 29 07:29 /etc/TIMEZONE -> ./default/init
if /etc/TIMEZONE not exist
ln -s /etc/default/init /etc/TIMEZONE
and look for TZ in /etc/TIMEZONE
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
user x has a cron job that looks in a dir and moves teh files from 1 name to another except its not working correctly.
. /user/.profile # sorce the users profile
for file in `ls`; do
mv $file $file.`date +%Y%m%d%H%M%S``microsec`
done
microsec is a binary with 555 perm. on it in... (5 Replies)
Discussion started by: Optimus_P
5 Replies
2. UNIX for Advanced & Expert Users
Hi ,
I have written a shell script that takes the current date on the server and stores it in a file.
echo get /usr/home/data-`date '+%Y%d'`.xml> /usr/local/sandeep/GetFILE.ini
I call this GetFILE.ini file from an sftp program to fetch a file from /usr/home/ as location. The file is in... (3 Replies)
Discussion started by: bsandeep_80
3 Replies
3. UNIX for Dummies Questions & Answers
Hey guys,
I have a script called my_test:
# !/usr/bin/sh
`touch /usr/test/me`
The script has been saved in /usr/test/my_test
I have executed chmod 755 /usr/test/my_test
Then I have entered it into the cron file using crontab -e
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/test/my_test... (2 Replies)
Discussion started by: Beefy
2 Replies
4. Solaris
When I list whats in cron -l its fine but when I try to -e edit it...it returns a number 309 can't you not edit cron this way with solaris 10? I can do it fine in sol 8 and 9.
export EDITOR="vi" is set in my profile
I am using BASH
$ sudo crontab -l
Password:
#ident "@(#)root ... (5 Replies)
Discussion started by: kingdbag
5 Replies
5. Shell Programming and Scripting
Hi Guys.,,
This thing is driving me crazy..
I have this script which runs perfectly fine. If it is not able to connect to database it will drop a mail which it does when i ran it manually.
But when i am running it from crontab, the script is not sending mail to me but to my id(login id)... (0 Replies)
Discussion started by: mac4rfree
0 Replies
6. Red Hat
Hey all! I'm working on setting up a script to run with cron. I have thus far been unable to get it to successfully complete. I'm hoping you gurus can lend me a hand.
This is my crontab, the transfer script works fine the backup will not. The backup however does work when I execute it from the... (11 Replies)
Discussion started by: spiffyville
11 Replies
7. Shell Programming and Scripting
Hi Gurus,
I need to run a script every saturday at 7:05 PM. Below command is working in x86_64.
05 19 * * 6 /apps/informatica/scripts/inf_rest.ksh
However when I tried in HP-UX it is giving the below error.
crontab: error on previous line; unexpected character found in line.
Please... (4 Replies)
Discussion started by: svajhala
4 Replies
8. UNIX for Advanced & Expert Users
I have written a custom cron. This cron executes a rake task every 5 minutes. I also log the trace of this execution in a file locally on my server. The whole process seems to execute seamlessly every 5 minutes, but then it seems to log it in /var/log/syslog. I investigated on the syslog and found... (0 Replies)
Discussion started by: manjunath.nm89
0 Replies
9. Solaris
Hello, I am running Solaris 8. I have set a cron job that runs every couple hours. If I run the script manually, it runs just fine (logged in as root). The cron however will not run. It is producing an rc=1 error. Any thoughts would be appreciated. Thanks (4 Replies)
Discussion started by: jkmtm
4 Replies
10. Shell Programming and Scripting
i have written a script to sftp yesterday's logs from another server as below:
cd /export/home/abc/xyz/tt
d=`gdate -d'yesterday' +%Y%m%d`
sftp abc@XXX.XX.XX.XX<<EOF
cd /yyy/logs/archive
mget abc.log.$d*
EOF
cd /export/home/abc/xyz/scripts
nohup ./ss.sh PROD &
it is working fine... (2 Replies)
Discussion started by: ssk250
2 Replies
LEARN ABOUT OPENSOLARIS
settimeofday
gettimeofday(3UCB) SunOS/BSD Compatibility Library Functions gettimeofday(3UCB)
NAME
gettimeofday, settimeofday - get or set the date and time
SYNOPSIS
/usr/ucb/cc [ flag ... ] file ...
#include <sys/time.h>
int gettimeofday(tp, tzp)
struct timeval *tzp;
struct timezone *tzp;
int settimeofday(tp, tzp)
struct timeval *tzp;
struct timezone *tzp;
DESCRIPTION
The system's notion of the current Greenwich time is obtained with the gettimeofday() call, and set with the settimeofday() call. The cur-
rent time is expressed in elapsed seconds and microseconds since 00:00 GMT, January 1, 1970 (zero hour). The resolution of the system clock
is hardware dependent; the time may be updated continuously, or in clock ticks.
long tv_sec; /* seconds since Jan. 1, 1970 */
long tv_usec; /* and microseconds */
tp points to a timeval structure, which includes the following members:
If tp is a NULL pointer, the current time information is not returned or set.
tzp is an obsolete pointer formerly used to get and set timezone information. tzp is now ignored. Timezone information is now handled using
the TZ environment variable; see TIMEZONE(4).
Only the privileged user may set the time of day.
RETURN VALUES
A -1 return value indicates an error occurred; in this case an error code is stored in the global variable errno.
ERRORS
The following error codes may be set in errno:
EINVAL tp specifies an invalid time.
EPERM A user other than the privileged user attempted to set the time.
SEE ALSO
cc(1B), adjtime(2), ctime(3C), gettimeofday(3C), TIMEZONE(4)
NOTES
Use of these interfaces should be restricted to only applications written on BSD platforms. Use of these interfaces with any of the system
libraries or in multi-thread applications is unsupported.
tzp is ignored in SunOS 5.X releases.
tv_usec is always 0.
SunOS 5.11 30 Oct 2007 gettimeofday(3UCB)