Solved

Cron few days a month

Posted on 2011-03-02
6
419 Views
Last Modified: 2012-05-11
I wonder if there is a way to cron a job using @monthly to run from 3rd to 6th of every month, once a day only.
0
Comment
Question by:farzanj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 6

Expert Comment

by:night_monkey
ID: 35023899
how about setting up four separate identical cron jobs with a different schedule? setting each to run on the 3rd, 4th, 5th, and 6th?

too clunky?
0
 
LVL 1

Accepted Solution

by:
BasementCat earned 167 total points
ID: 35024045
I believe you can put multiple values in a single field in your crontab file, like so:
0    0   3,4,5,6    *    *   ./your-command

Open in new window

which would run the command on the 3rd, 4th, 5th, and 6th of every month at 12:00 am
0
 
LVL 12

Assisted Solution

by:mccracky
mccracky earned 83 total points
ID: 35024088
BasementCat is correct and bear me to it.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:mccracky
ID: 35024090
s/bear/beat/
0
 
LVL 1

Assisted Solution

by:BasementCat
BasementCat earned 167 total points
ID: 35024097
As a side note, you may be able to use a hyphenated range instead - rather than 3,4,5,6 you probably can use 3-6
0
 
LVL 31

Author Closing Comment

by:farzanj
ID: 35024109
Sorry, dumb question
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question