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
Crontab Entry Dastard Shell Programming and Scripting 5 02-10-2007 02:22 AM
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
crontab entry matrixmadhan UNIX for Dummies Questions & Answers 3 06-07-2005 08:57 AM

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-08-2007
Sowser Sowser is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 90
crontab entry

Sometimes cron really upsets me and I cant figure out these types of wierd dates, but how do I get cron to run something on every other sunday? I am running Solaris 8.

-S
  #2 (permalink)  
Old 01-08-2007
_Spare_Ribs_'s Avatar
_Spare_Ribs_ _Spare_Ribs_ is offline
Registered User
  
 

Join Date: Dec 2006
Location: /dev/null
Posts: 72
Hi,

As far as I am aware this is not possible. I think the best solution is to add some logic to the script itself. I found a similar discussion here.

http://forums.hostmatters.com/archiv...hp/t-1091.html

Hope this helps.
  #3 (permalink)  
Old 01-08-2007
Sowser Sowser is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 90
logic

Yea, I found some things about it on the web and a lot of them had to do with putting logic into the scripts. It wasnt what i was anticipating to make this happen.

I was hoping there was a 'cron' way of doing it. But I am starting to think that my hopes are going to be dashed and i will have to write additional code to give me odd and even weeks.

But if anyone has any easy way for this, please by all means, the forum is open.

Thanks.
-S
  #4 (permalink)  
Old 01-08-2007
_Spare_Ribs_'s Avatar
_Spare_Ribs_ _Spare_Ribs_ is offline
Registered User
  
 

Join Date: Dec 2006
Location: /dev/null
Posts: 72
Code:
# set to 0 to skip even-numbered weeks, 1 to skip odd-numbered weeks
SKIPWEEK=0 
# the number of the current week (01-52) 
WEEK=`date +%V` 
if [ `expr $WEEK % 2` -eq $SKIPWEEK ]; then
exit 0
fi
no need to write additional code, it's been done for you
  #5 (permalink)  
Old 01-08-2007
Sowser Sowser is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 90
nice....

That is very nasty. (compliment)

Thanks for the help.

-S
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 08:05 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