The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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 4 07-04-2009 05:47 AM
date issue-find prevoius date in a patricular format bsandeep_80 UNIX for Advanced & Expert Users 3 11-15-2007 08:42 PM
convert mmddyy date format to ccyyddd format?? Bhups Shell Programming and Scripting 2 09-27-2006 11:30 PM
crontab -e dosent work dozy UNIX for Dummies Questions & Answers 11 05-26-2003 05:59 AM
OS X / fsck / apps dont work no control panel maxwell Filesystems, Disks and Memory 0 08-14-2002 08:03 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-28-2008
p4cldba p4cldba is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 15
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
  #2 (permalink)  
Old 06-28-2008
bankai bankai is offline
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 ?
  #3 (permalink)  
Old 06-29-2008
adzuanamir adzuanamir is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 40
at least u can put crontab -l here
  #4 (permalink)  
Old 06-29-2008
p4cldba p4cldba is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 15
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
  #5 (permalink)  
Old 06-30-2008
bankai bankai is offline
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
  #6 (permalink)  
Old 06-30-2008
p4cldba p4cldba is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 15
I tried both in solaris and AIX . but I could not make it work.
  #7 (permalink)  
Old 06-30-2008
jhtrice's Avatar
jhtrice jhtrice is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 69
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.
Closed Thread

Bookmarks

Tags
solaris

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:39 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0