Solved

Setup crons to run consecutively

Posted on 2014-11-09
4
148 Views
Last Modified: 2014-11-09
Hello,

I have 3 crons that need to run minutes apart and they need to start every 45 minutes.

Currently I am running them every hour and that is easy because I can set the times, but I need to up the frequency and I a not sure how to do that.

0      */1      *      *      *      wget -O /dev/null http://domain.com/cl/parse.php?action=list_page
10      */1      *      *      *      wget -O /dev/null http://domain.com/cl/parse.php?action=parse_page
15      */1      *      *      *      wget -O /dev/null http://domain.com/cl/parse.php?action=download_image

It would be ideal if I could make them all run in the same cron so once one was finished it triggered the other... but I don't think that is possible.

Matt
0
Comment
Question by:movieprodw
4 Comments
 
LVL 15

Accepted Solution

by:
Haris Djulic earned 500 total points
Comment Utility
Can you make the batch script to this job and  and then call it every 45 minutes?

You create the script like this :

#!/bin/bash
wget -O /dev/null http://domain.com/cl/parse.php?action=list_page
sleep 5m
wget -O /dev/null http://domain.com/cl/parse.php?action=parse_page
sleep 5m
wget -O /dev/null http://domain.com/cl/parse.php?action=parse_page

Open in new window


You save this script to /home/your_user/wget_script.sh and your cron file will be

45 */1 * * *  /home/your_user/wget_script.sh

Open in new window

0
 
LVL 23

Expert Comment

by:savone
Comment Utility
To run a cronjob every 45 minutes you can use:

*/45 * * * * wget -O /dev/null http://domain.com/cl/parse.php?action=list_page
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Make one script that calls the others in sequence.
0
 
LVL 1

Author Closing Comment

by:movieprodw
Comment Utility
Thanks!

I think this will work.

The issue is that the scripts take a long time and will timeout if I run them all together.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

763 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

12 Experts available now in Live!

Get 1:1 Help Now