Solved

Setup crons to run consecutively

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

740 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