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 Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Crontab Entry Dastard Shell Programming and Scripting 5 02-10-2007 02:22 AM
crontab entry Sowser UNIX for Advanced & Expert Users 4 01-08-2007 05:34 PM
remove an entry in crontab melanie_pfefer SUN Solaris 1 12-18-2006 05:45 AM
amending crontab entry hcclnoodles Shell Programming and Scripting 1 10-26-2006 07:32 AM
Crontab entry bestbuyernc Shell Programming and Scripting 1 09-12-2005 03:13 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-06-2005
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,944
crontab entry

hi all

how to schedule a cron job running on last day of every third month at
12 midnight

will the following work
0 0 30,31 3,6,9,12 * <required file>

thanks
  #2 (permalink)  
Old 06-07-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
That should work but then again, I don't remember ever setting up a cron job to run on a day that doesn't exist (as in your June 31st). Suggest you monitor it so you know that it won't cause problems OR change it to two lines:

0 0 30 6,9 * <required file>
0 0 31 3,12 * <required file>
  #3 (permalink)  
Old 06-07-2005
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
The original would also run twice in March and December (on both the 30th and 31st of the month).

RTM's suggestion for two seperate lines is the way to go....
  #4 (permalink)  
Old 06-07-2005
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,944
crontab entry

hi

thanks for the reply

will this work

//inside the script ( which is to entered in the crontab )
currMonth=`date '+%m'`
currDate=`date '+%d'`

case $currMonth in

03|12) lastDate=31
;;
06|09) lastDate=30
;;
esac

if [ $currDate = $lastDate ]
then
**** run the program here ********
fi

thanks
Sponsored Links
Closed Thread

Bookmarks

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 04:42 AM.


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