LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-17-2018, 04:25 AM   #1
manolakis
Member
 
Registered: Nov 2006
Distribution: xubuntu
Posts: 464

Rep: Reputation: 37
Schedule php script every hour, half an hour, and 15 minutes


Hello,

I have 3 different php scripts which I want to execute in my ubuntu every hour, half an hour, and every 15 minutes.
Can anybody show me how is it possible to do that?

Thank you
 
Old 08-17-2018, 04:45 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Every 15 minutes covers the other cases. Use cron or systemd timers.

Edit: ah, maybe you should explain yourself better. Is it:
- one script every hour
- another script every half hour
- another script every 15 minutes ?.

We are not mind readers, and you have been a member for over a decade and should know how to post.

Regardless - cron or systemd timers.

Last edited by syg00; 08-17-2018 at 04:47 AM.
 
Old 08-17-2018, 05:00 AM   #3
manolakis
Member
 
Registered: Nov 2006
Distribution: xubuntu
Posts: 464

Original Poster
Rep: Reputation: 37
There are 3 different scripts where one of them needs to execute every hour, the other every half-hour and the last every 15 minutes.
I have heard of cron but I have never used it before and I was hoping if anyone had the kindness to give me instructions how to edit the tasks.

Thank you
 
Old 08-17-2018, 05:58 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Code:
man crontab
Code:
man 5 crontab
Basically - every hour:
Code:
00 * * * * /path/to/php /path/to/your/hourlyscript.php
Every 15 mins:
Code:
00,15,30,45 * * * * /path/to/php /path/to/your/15minscript.php
 
2 members found this post helpful.
Old 08-17-2018, 12:43 PM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
http://cronsandbox.com
for visual re-inforcement and "testing"
 
1 members found this post helpful.
Old 08-22-2018, 07:43 AM   #6
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Alternate syntax for every N minutes (replace N with the number of minutes, 15, 30...)
Code:
*/N * * * * /path/to/php /path/to/your/Nminscript.php
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron job issue - every hour works, but specific hour fails lunarleviathan Linux - Newbie 6 11-20-2009 12:19 AM
sending DHCP_REQUEST every half hour, why please glorsplitz Linux - Networking 3 12-04-2007 09:11 PM
change clock from 24 hour to 12 hour in suse 9.2/KDE 3.3 jmlumpkin Linux - Newbie 1 01-22-2005 11:45 PM
Computer locks up linux, after 10 minutes, hour, 2 days. 2 and half max! RHLinuxGUY Linux - Hardware 26 10-19-2004 07:03 PM
half-hour to boot? rob-n Linux - Newbie 4 05-01-2004 04:36 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration