Solved

Setup crons to run consecutively

Posted on 2014-11-09
4
151 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
ID: 40431555
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
ID: 40431556
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 83

Expert Comment

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

Author Closing Comment

by:movieprodw
ID: 40431638
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses how to create an extensible mechanism for linked drop downs.
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…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

911 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

21 Experts available now in Live!

Get 1:1 Help Now