Solved

Setup crons to run consecutively

Posted on 2014-11-09
4
158 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
[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
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

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…
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 …
The viewer will learn how to dynamically set the form action using jQuery.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

728 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