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
Passing arguments to a shell script from file while scheduling in cron weblogicsupport SUN Solaris 4 01-27-2008 11:16 PM
Problem with scheduling a shell script on cygwin using cron shash UNIX for Dummies Questions & Answers 4 08-09-2007 06:08 PM
scheduling tasks with cron alikun UNIX for Dummies Questions & Answers 4 03-21-2007 04:32 PM
cron job scheduling shihabvk UNIX for Advanced & Expert Users 1 08-22-2005 10:36 AM
scheduling prashantuc UNIX for Dummies Questions & Answers 2 05-11-2001 03:39 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 09-13-2007
LPT LPT is offline
Registered User
  
 

Join Date: Sep 2007
Location: Orange County, CA
Posts: 2
Scheduling bi-weekly through cron

Is there a way in AIX to schedule a script to run bi-weekly through cron?

I have a script that needs to run every other Wednesday, and this is what I thought I had to enter in the crontab file:

00 08 * * 3/2 /home/user/user.script

It didn't like that. It reports a syntax error. I'm almost positive that in Linux and/or Solaris something like that will work, or I may be totally off....

Any suggestions, would be greatly appreciated!

Thanks in advance!
  #2 (permalink)  
Old 09-13-2007
daveisme daveisme is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 39
how about
00 08 1-7,15-21 * 3 /home/user/user.script

This should give you the 1st and 3rd web of every month.
  #3 (permalink)  
Old 09-13-2007
LPT LPT is offline
Registered User
  
 

Join Date: Sep 2007
Location: Orange County, CA
Posts: 2
Thanks a bunch, daveisme!! You're the bomb...!! I'd never thought of that..!
  #4 (permalink)  
Old 09-14-2007
kahuna's Avatar
kahuna kahuna is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 149
Quote:
Originally Posted by daveisme View Post
how about
00 08 1-7,15-21 * 3 /home/user/user.script

This should give you the 1st and 3rd web of every month.
I think day of the week is an "or" rather than an "and". I've been bitten by this before. From the man page.
Quote:
This example

0 0 1,15 * 1

would run a command on the first and fifteenth of each
month, as well as on every Monday.
  #5 (permalink)  
Old 02-19-2009
hard aix hard aix is offline
Registered User
  
 

Join Date: Feb 2009
Location: Martinez, Taxifornia
Posts: 25
Quote:
Originally Posted by LPT View Post
Is there a way in AIX to schedule a script to run bi-weekly through cron?
Try this:
Code:
00 08 * * 3  [[ $(expr `date +%W` % 2) = 0 ]] && /home/user/user.script
depending on the bi-weekly cycle you may need a "= 1" instead.
  #6 (permalink)  
Old 02-20-2009
bishweshwar bishweshwar is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 56
I guess it will run from 1-7 & 15-21, and every wednesday. so how does it go bi-weekly.
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:31 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