473,657 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4138
On 2004-01-22, smarty <sm****@hot.e e> 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.e e> 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.e e> 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
2693
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 will show the peak number of agents logged in concurrently during a specified time period. Within the time period, the person viewing the report should be able to
29
2252
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 C++? What am I doing wrong? Here is my code: using System;
3
1143
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, they must request that one be created. with a sql server stored procedure, the object takes about 30-45 seconds to create itself. i want to give a user a form and when they click the button the object gets created. when this happens, i want the...
0
1386
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 Combo control, which I think I still prefer, so I'll share it here. It has two main features. One, an Increment Property, which allows you to set whether you see every minute of the day, every five minutes, ten, fifteen, twenty, thirty, or just...
2
2801
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 like 2:31:15, 2:32:15, 2:33:15.., can anyone help this out? Thanks
5
4151
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 next where the final date and time will be set to a new datetime variable.
3
2198
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 someone help me with the function to so this? thanks paul
15
1929
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 players allows the user to optimize the copying of a compact disc to cassette. The user specifies the size of the cassette; the player selects the tracks that will best fill the first side of the cassette and plays them, then plays the
1
5579
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 seems to have improved a lot compared to the earlier ones).* Unfortunately, I have limited knowledge of DB2, especially in setting the server parameters, their impact on an environment with high concurrency etc. As a result, we are getting very high...
0
8413
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8324
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8740
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8513
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7352
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.