UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 2nd, 2006, 06:42 AM
sparab sparab is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 2 sparab User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 11 m 9 sec
Reputation Power: 0
Question How to create output(log) file in crontab

following is my crontab file:

#!/bin/csh
setenv ORACLE_HOME /topo1/app/oracle/product/10g
setenv SDEHOME /topo4/arcsde/sdeexe91
setenv ORACLE_BASE /topo1/app/oracle
setenv ORACLE_SID plandb
setenv NLS_LANG american_america.UTF8
setenv TNS_ADMIN $ORACLE_HOME/network/admin
setenv ORA_NLS33 $ORACLE_HOME/nls/data
setenv LD_LIBRARY_PATH $SDEHOME/lib:$SDEHOME/bin:$ORACLE_HOME/lib:/usr/openwin/lib:/usr/dt/lib:/usr/dt/bin
setenv PATH $SDEHOME/bin:$SDEHOME/etc:$SDEHOME/etc/bin:/usr/local/bin:/usr/ccs/bin:$ORACLE_HOME/bin:/usr/bin:/usr/ucb:/etc
$HOME/bin/copy_to_gsdb.txt

My crontab is working fine and in /var/cron/log there is no error.

I want to create log file to see all the unix command in $HOME/bin/copy_to_gsdb.txt is executed properly. I mean the output file. How can I create it?

Reply With Quote
  #2  
Old August 2nd, 2006, 11:24 AM
Ehlanna's Avatar
Ehlanna Ehlanna is offline
Not a clue what to put ...
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2006
Location: in front of this keyboard
Posts: 815 Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level)Ehlanna User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Weeks 2 Days 5 h 43 m 48 sec
Reputation Power: 243
Chuck file redirection onto either the command shown or the actual command in the crontab for both stdout and stderr - like command > /tmp/log.txt 2>&1 or, you could check your mail, errors in cron tend to be sent via mail to the user under which they are running.
__________________
According to Sod's Law, buttered toast lands butter side down, when dropped.
Per nature, cats always land on their feet.
So, what happens when you strap buttered toast to the back of a cat and throw it out a window?
.

Reply With Quote
  #3  
Old August 3rd, 2006, 02:58 AM
sparab sparab is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2006
Posts: 2 sparab User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 11 m 9 sec
Reputation Power: 0
Thanks Ehlana!!!
I got it. In mail.
Thanks and Regards

Reply With Quote
  #4  
Old September 6th, 2006, 12:21 AM
thats.rahul thats.rahul is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Posts: 2 thats.rahul User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 21 sec
Reputation Power: 0
Question Unix Shell Scripting Problem

HI there,

I need to create a time-stamped log file that records all the user activities of the user and saves them in the log file at a particular location.............

Kindly help me with that.
I need the code for that

Thanking you

Rahul Bhatnagar

rahul-b@hotmail.com

Reply With Quote
  #5  
Old September 6th, 2006, 04:42 AM
SimonJM SimonJM is offline
Contributing User
Dev Shed Novice (500 - 999 posts) Click here for more information
 
Join Date: Mar 2006
Posts: 762 SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level)SimonJM User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 2 Weeks 1 Day 22 h 8 m 4 sec
Reputation Power: 336
cron does not tend to permit such variable-based things so you would need to address that issue within your script.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > How to create output(log) file in crontab


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT