Solved

Cron few days a month

Posted on 2011-03-02
6
414 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
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now