473,395 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to execute a tasks if the time is 22:30:45

crontab work every minute

How to execute a tasks if the time is 22:30:45 or 22:31:01

id | time | script
-------------------
4 | 22:31:01 | script0.php
3 | 22:31:00 | script1.php
2 | 22:30:45 | script3.php
1 | 22:30:00 | script2.php
My server: Apache 1.3.29, PHP 4.3.4, MySQL
Jul 17 '05 #1
4 4114
On 2004-01-22, smarty <sm****@hot.ee> wrote:
crontab work every minute

How to execute a tasks if the time is 22:30:45 or 22:31:01

id | time | script
-------------------
4 | 22:31:01 | script0.php
3 | 22:31:00 | script1.php
2 | 22:30:45 | script3.php
1 | 22:30:00 | script2.php


The best way is just to use crontab (for the correct syntax use the
manual, but i think it would like this)
01 * * * * * script0.php
00 * * * * * script1.php
45 * * * * * script3.php
00 * * * * * script2.php

Or you can make a script crontab.php and let crontab call that every
minute (having a look at the php manual, section about date and time
functions will provide you all the info that you need)

--
http://home.mysth.be/~timvw
Jul 17 '05 #2
On 2004-01-22, smarty <sm****@hot.ee> wrote:
crontab work every minute

How to execute a tasks if the time is 22:30:45 or 22:31:01


http://be2.php.net/manual/en/function.sleep.php

--
http://home.mysth.be/~timvw
Jul 17 '05 #3
Tim Van Wassenhove <eu**@pi.be> wrote in message news:<bu************@ID-188825.news.uni-berlin.de>...
On 2004-01-22, smarty <sm****@hot.ee> wrote:
crontab work every minute

How to execute a tasks if the time is 22:30:45 or 22:31:01


http://be2.php.net/manual/en/function.sleep.php


Crontab time intervals will be checking the database every 1 min.
If crontab check the 'schedule' table, 'tasktime' field and time is 22:34:25
How script can extract this '25' seconds and put this to sleep(25)
Jul 17 '05 #4
ok my example was wrong

this script work stand-alone in server and don't need any browser.

id | time | command | status
---------------------------------
3 | 12:35:15 | com.php | idle
2 | 12:34:55 | com.php | idle
1 | 12:34:45 | com.php | idle

cron check and time now 12:34:00

if seconds is 00 and status idle

run exec command

else if seconds 01 – 59 and status idle

count how many times 01-59 // how to make the loop
if 2 times (12:34:45 and 12:34:55)
sleep(45)
run command
sleep(10)
run command

next cron check 12:35:00
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dave | last post by:
Hi I am hoping someone might be able to help me out with this. I am writing a helpdesk system which records agents logging in and out of the system. I need to write a stored procedure which...
29
by: Roy Gourgi | last post by:
Hi, I am new to C#. I have the same time scheduling program written in C++ and it is 5 times faster than my version in C#. Why is it so slow as I thought that C# was only a little slower than...
3
by: Antonio Policelli | last post by:
Hello, please tell me how to do this.. I have a web page that a user can manipulate and work with a database object. it is not important what that is but for the user to start on a new object,...
0
by: Ed Bick | last post by:
Well, I read today about how I could set the dropdown value to False to change the control from presenting a Calendar to cycling through the times. Before getting that, I developed a custom Time...
2
by: martin1 | last post by:
All, timer interval is 60 sec, i want ot set up timer start 15 sec later after minute. for example if current time is 2:30:00, the timer starts 2:30:15, then timer loop procedure every minute...
5
by: simon_s_li | last post by:
Hi, I need to add 48 hours to a specific date (datetime data type) then check if the time is past 5pm. So for example the time is 7pm. If this is the case I need to set the time to 5pm the...
3
by: Paul Wagstaff | last post by:
Hi All I have an aggregate query that groups by each user, then calculates Sum(TimeInvested). I need to display the total time (per user) in hrs / mins e.g. 45:30 (= 45 hrs 30 mins). Can...
15
jeffbroodwar
by: jeffbroodwar | last post by:
Hi everyone, Take a look at this problem. try to answer this program using a single class... : Problem 1: CD Dubbing Optimization A feature now becoming available on some compact disc...
1
by: sanjupommen | last post by:
I am in the process of exploring the possibility of providing our products on databases other than Oracle.I am able to migrate the data, procedures etc without too much effort (latest version of DB2...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.