?
Solved

Cron few days a month

Posted on 2011-03-02
6
Medium Priority
?
420 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 668 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 332 total points
ID: 35024088
BasementCat is correct and bear me to it.
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 12

Expert Comment

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

Assisted Solution

by:BasementCat
BasementCat earned 668 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses
Course of the Month11 days, 3 hours left to enroll

770 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