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 question blondie2407 HP-UX 12 09-16-2009 01:53 PM
Crontab Question. NycUnxer UNIX for Dummies Questions & Answers 9 11-14-2007 11:53 AM
Crontab question ctcuser Shell Programming and Scripting 3 10-19-2006 09:22 AM
crontab question steelrose UNIX for Dummies Questions & Answers 5 10-05-2005 12:07 AM
crontab question Relykk UNIX for Dummies Questions & Answers 7 03-28-2004 08:02 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 01-23-2007
pauls_579 pauls_579 is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 1
CRONTAB Question

Is there a way to setup a crontab job to run the second sunday of every month?
  #2 (permalink)  
Old 01-23-2007
kjbaumann kjbaumann is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 49
Not that I know of. Cron format is MIN HOUR DAY MONTH WEEKDAY :

* 23 * * 0 /home/test.sh

That would run the test.sh script at 11:00 PM on Sunday, but it would do every Sunday of the month. Other people might know of a way. Good luck.
  #3 (permalink)  
Old 01-23-2007
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,119
Assuming you're on the US locale [the week starts on 'Sunday'].... to run at 2am every second sunday every month
Code:
0 2 * * * [ `cal | nawk -v sun=2 'NR==3 {i=(NF==7) ? 2 : 1; next} NR > 2 && int(sun+i) == NR {print $1}'` -eq `date +%e` ] && myScriptToRun.sh
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 11:06 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