[php] task schedulen

Pagina: 1
Acties:
  • 60 views sinds 30-01-2008

  • Blizard
  • Registratie: September 2001
  • Niet online
Weet niet of het echt een php probleem is en of het hier thuishoort.
Maar ik wil vanuit php een task aanmaken die bv om middernacht moet worden gerunt (dus gewoon een pagina waar ik een datum kan kiezen wanneer een taak gerunt moet worden). Heb al gezocht naar command line task schedulen, maar ik kom altijd uit op die verdomde GUI :/
Iemand tips ?

  • MeIsTwisted
  • Registratie: November 2001
  • Laatst online: 28-07-2023

MeIsTwisted

not a Twisted mind

cron jobs

Multimonitor is relax :P


  • Sybr_E-N
  • Registratie: December 2001
  • Laatst online: 13-05 20:39
PHP scripts leven alleen maar als ze worden aangeroepen. Je zult met behulp van een extern hulpmiddel je PHP scripts moeten aanroepen in Unix-achtige systemen zijn dat de cronjobs (crontab) en in Windows systemen de taakplanner.

  • Blizard
  • Registratie: September 2001
  • Niet online
Het gaat dus om een windows-machine.
Het is de bedoeling dat op de php pagina een taak ge-add wordt bij de geplande taken... Jammer genoeg is dit geen plain text die je zomaar even zelf kan schrijven blijkbaar ?

  • pjonk
  • Registratie: November 2000
  • Laatst online: 29-12-2025
Blizard schreef op zondag 23 januari 2005 @ 20:34:
Het gaat dus om een windows-machine.
Het is de bedoeling dat op de php pagina een taak ge-add wordt bij de geplande taken... Jammer genoeg is dit geen plain text die je zomaar even zelf kan schrijven blijkbaar ?
AT aanroepen via de commandline via http://nl3.php.net/manual/en/function.system.php.
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
The AT command schedules commands and programs to run on a computer at      
a specified time and date. The Schedule service must be running to use      
the AT command.
                                                           
AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]                    
AT [\\computername] time [/INTERACTIVE]
    [ /EVERY:date[,...] | /NEXT:date[,...]] "command"

\\computername     Specifies a remote computer. Commands are scheduled on the
                   local computer if this parameter is omitted.             
id                 Is an identification number assigned to a scheduled      
                   command.                                                 
/delete            Cancels a scheduled command. If id is omitted, all the
                   scheduled commands on the computer are canceled.
/yes               Used with cancel all jobs command when no further
                   confirmation is desired.
time               Specifies the time when command is to run.
/interactive       Allows the job to interact with the desktop of the user   
                   who is logged on at the time the job runs.
/every:date[,...]  Runs the command on each specified day(s) of the week or
                   month. If date is omitted, the current day of the month
                   is assumed.                                              
/next:date[,...]   Runs the specified command on the next occurrence of the
                   day (for example, next Thursday).  If date is omitted, the
                   current day of the month is assumed.
"command"          Is the Windows NT command, or batch program to be run.

It’s nice to be important but it’s more important to be nice


  • semicolon
  • Registratie: Mei 2004
  • Niet online
Recht uit mijn scriptje (deze is om de 5 minuten)
# Taak toevoegen:
# schtasks /create /sc minute /mo 5 /tn "Titel" /tr "C:\PHP\php.exe -q D:\Web\test.php"
# Taak verwijderen:
# schtasks /delete /tn "Titel"
# beantwoorden met Y

schtasks /? zal je wel genoeg hulp bieden als je het nodig hebt verder

[ Voor 20% gewijzigd door semicolon op 23-01-2005 20:49 ]

:D/-<


  • Blizard
  • Registratie: September 2001
  • Niet online
Thanks !
Heb dit ook nog gevonden op internet : http://www.angorasoftware.com/NTScheduler/

Ziet er op zich wel leuk uit, maar is het te betrouwen (doet hier trouwens niet echt veel ?)

  • Creepy
  • Registratie: Juni 2001
  • Laatst online: 18:05

Creepy

Tactical Espionage Splatterer

Er zijn genoeg manier om zoiets te doen. Met de GoT search en Google ga je dat echt zelf wel vinden. Er is ook ziets als een task scheduler onder windows ;)

"I had a problem, I solved it with regular expressions. Now I have two problems". That's shows a lack of appreciation for regular expressions: "I know have _star_ problems" --Kevlin Henney

Pagina: 1

Dit topic is gesloten.