Solved

Cron few days a month

Posted on 2011-03-02
6
418 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
Industry Leaders: 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

733 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