[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Cron Job every minute during Game Time

Posted on 2010-09-09
6
Medium Priority
?
509 Views
Last Modified: 2012-05-10
Experts,
I'm trying to run a cron job to update my scores page every minute (but only when Football Games are playing).  There won't be any score updates when the games are not being played.

The updates really need to happen during these times:
Thursday (7:00 PM EST - 1:00 AM EST) to account for late finishes
Friday (7:00 PM EST - 1:00 AM EST) to account for late finishes
Saturday (12:00 PM EST - 2:00 AM EST) to account for late finishes
Sunday (12:00 PM EST - 2:00 AM EST) to account for late finishes
Monday (7:00 PM EST - 1:00 AM EST) to account for late finishes

To make it simple I tried to every minute between 12PM and 1AM Thursday through Monday

*/1        11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2        *        *        4,5,6,0,1

It is not working correctly.

Ideally, I suppose 2 different ones could work.
1.  One on Thursday, Friday, Monday at:  7:00 PM EST - 1:00 AM EST
2.  the other on Saturday, Sunday at: 12:00 PM EST - 2:00 AM EST

Any ideas?

Thanks in advance,

-Dan
0
Comment
Question by:dsg138
[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 12

Expert Comment

by:mccracky
ID: 33642290
cron only runs once every minute, the first column should just be * and not */1 and I'd probably put the days in numerical order.
0
 
LVL 2

Expert Comment

by:Orcen
ID: 33642386
Uhm, the 2nd field is the hour, not the days to run:

*     *     *   *    *        command to be executed
-     -     -   -    -
|     |     |   |    |
|     |     |   |    +----- day of week (0 - 6) (Sunday=0)
|     |     |   +------- month (1 - 12)
|     |     +--------- day of        month (1 - 31)
|     +----------- hour (0 - 23)
+------------- min (0 - 59)
0
 

Author Comment

by:dsg138
ID: 33642436
Yes, the second field is the hour so I am trying to give it the hours in which it should run every minute.

1.  Every minute
2.  During the hours of 12PM - 1AM (11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2)  
3.  
4.  
5.  These days of the week: Thursday, Friday, Saturday, Sunday, Monday (4,5,6,0,1)

When the hours are listed that way, they are in order by time.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Expert Comment

by:Orcen
ID: 33642467
You can try this:

*/1 11,12,13,14,15,16,17,18,19,20,21,22,23,0,1,2  *   *   4-1


Remember to check the cron's log to see if there are no other issues (such as permission issues, etc).
0
 
LVL 48

Accepted Solution

by:
Tintin earned 2000 total points
ID: 33644112
* 11-23,0-2 * * 4-6,0-1
0
 

Author Closing Comment

by:dsg138
ID: 33657174
This one worked for me!
Thanks everyone for the help!
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

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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.
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

650 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