The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
IDL job doesn't work from crontab SharkM Shell Programming and Scripting 2 02-25-2008 03:30 AM
date issue-find prevoius date in a patricular format bsandeep_80 UNIX for Advanced & Expert Users 3 11-15-2007 05:42 PM
convert mmddyy date format to ccyyddd format?? Bhups Shell Programming and Scripting 2 09-27-2006 08:30 PM
crontab -e dosent work dozy UNIX for Dummies Questions & Answers 11 05-26-2003 02:59 AM
OS X / fsck / apps dont work no control panel maxwell Filesystems, Disks and Memory 0 08-14-2002 05:03 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 06-28-2008
Registered User
 

Join Date: Apr 2008
Posts: 13
why the date format dont work in crontab

Hi

I tried to put a cron job which pipes the logfile appended to date +%d
but it didnt work .

anyone know how to make this happen

thanks in advance
-prasad
Reply With Quote
Forum Sponsor
  #2  
Old 06-28-2008
Registered User
 

Join Date: Jun 2008
Posts: 23
not seeing any code or any error messages, it's hard to tell what the problem is - maybe a $PATH problem ?
Reply With Quote
  #3  
Old 06-29-2008
Registered User
 

Join Date: Apr 2008
Posts: 39
at least u can put crontab -l here
Reply With Quote
  #4  
Old 06-29-2008
Registered User
 

Join Date: Apr 2008
Posts: 13
sorry about the delay.

this is the crontab entry.

0 17 * * * /home/oracle/bin/move_archlog.ksh > /home/oracle/log/move_archlog.cron.log.`date +%m%d%y` 2>&1

So it is creating logfile name as
move_archlog.cron.log.Sat May 31 17:00:00 PDT 2008
instead of
move_archlog.cron.log.060208
Reply With Quote
  #5  
Old 06-30-2008
Registered User
 

Join Date: Jun 2008
Posts: 23
works fine for me on freebsd - what *nix OS you running?

p.s if you're going to use dated logs, it's best to use the universal standard of YYYYMMDD
Reply With Quote
  #6  
Old 06-30-2008
Registered User
 

Join Date: Apr 2008
Posts: 13
I tried both in solaris and AIX . but I could not make it work.
Reply With Quote
  #7  
Old 06-30-2008
jhtrice's Avatar
Registered User
 

Join Date: Jun 2008
Posts: 63
Do this.

0 17 * * * /home/oracle/bin/move_archlog.ksh > /home/oracle/log/move_archlog.cron.log.`date +\%m\%d\%y` 2>&1

You may need to escape the %s.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
solaris

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 01:42 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0