RE: [PHP-DB] Newbie:Backend scripts

2001-07-06 Thread Mats Remman

windows 2000 has a command called 'at' .. which is somewhat like crontab.
and
there is no reason to run lynx and whatever. 
php for windows has an exe for a reason

'php.exe c:\path\to\phpfile.php'

schedule that every two hours.

Mats Remman
PHP Developer/Mysql DBA
Coretrek, Norway
+47 51978597 / +47 916 23566

 

 -Original Message-
 From: PHPFAN [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 06, 2001 4:53 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] Newbie:Backend scripts
 
 
 Thank you very much for your help Beau!!!
 
 Sagil.
 
 
 Beau Lebens [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  // OK, i just checked and tested (jeez i'm a nice guy.. :P) and
  // dodgy Windoze
  // schedule doesn't allow you to do it by the hour, so if you
  // want it every 2
  // hours, you'll have to set one, daily at 2am, one daily at
  // 4am etc etc, all
  // doing the same thing.
 
 
  change this, under the Schedule Advanced settings for the scheduled
 event
  you can
 
  Repeat Task
 
  every x minutes/hours etc, so only need one scheduled event for 
 it all :)
 
  beau
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Newbie:Backend scripts

2001-07-05 Thread Beau Lebens

Sagil,
the way I do something like this is write a script using PHP that does
exactly what you want, without any input or anything like that, then just
set up cron to run that script every 2 hours. you can use either lynx to hit
it as a webpage, or it's an admin script or something that you don't want
other people to be able to hit (because it'd be in the web-root) then you
can put it outside the documentroot and use the php cgi to run it.

if you use lynx, do something like this in your crontab entry (the 'timing'
might be wrong)

*   2,4,6,8,10,12   *   *   *   lynx -source
http://yourscript  /dev/null

that will just get the source of the page, then pipe it to the 'bin' so to
speak, but in doing this, it will perform whatever operations you have told
it to in the script

HTH

Beau

// -Original Message-
// From: PHPFAN [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 6 July 2001 9:43 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Newbie:Backend scripts
// 
// 
// Hi,
// 
// I am using php4 with mssql backend loaded on windows 2000.
// 
// Here is my problem:
// 
// I want to update my database contents every 2 hours with some sql
// statements.
// Is there anyway I can write scripts in php and run them 
// every 2 hours?
// Anyother solutions are most welcome.
// 
// Thank You,
// Sagil.
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Newbie:Backend scripts

2001-07-05 Thread PHPFAN

Hello Beau Lebens,

Thank you very much for the advice.
I am using windows 2000/NT.So do you happen to know how to handle it in
windows?

Sagil.


Beau Lebens [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Sagil,
 the way I do something like this is write a script using PHP that does
 exactly what you want, without any input or anything like that, then just
 set up cron to run that script every 2 hours. you can use either lynx to
hit
 it as a webpage, or it's an admin script or something that you don't want
 other people to be able to hit (because it'd be in the web-root) then you
 can put it outside the documentroot and use the php cgi to run it.

 if you use lynx, do something like this in your crontab entry (the
'timing'
 might be wrong)

 * 2,4,6,8,10,12 * * * lynx -source
 http://yourscript  /dev/null

 that will just get the source of the page, then pipe it to the 'bin' so to
 speak, but in doing this, it will perform whatever operations you have
told
 it to in the script

 HTH

 Beau

 // -Original Message-
 // From: PHPFAN [mailto:[EMAIL PROTECTED]]
 // Sent: Friday, 6 July 2001 9:43 AM
 // To: [EMAIL PROTECTED]
 // Subject: [PHP-DB] Newbie:Backend scripts
 //
 //
 // Hi,
 //
 // I am using php4 with mssql backend loaded on windows 2000.
 //
 // Here is my problem:
 //
 // I want to update my database contents every 2 hours with some sql
 // statements.
 // Is there anyway I can write scripts in php and run them
 // every 2 hours?
 // Anyother solutions are most welcome.
 //
 // Thank You,
 // Sagil.
 //
 //
 //
 // --
 // PHP Database Mailing List (http://www.php.net/)
 // To unsubscribe, e-mail: [EMAIL PROTECTED]
 // For additional commands, e-mail: [EMAIL PROTECTED]
 // To contact the list administrators, e-mail:
 // [EMAIL PROTECTED]
 //



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Newbie:Backend scripts

2001-07-05 Thread Beau Lebens

Sagil,
you can get a binary for lynx from the web (search for it, can't remember
url off the top of my head :P), install that, then make a quick batch file
such as;

scheduled.bat-
@echo off
c:
cd \lynx\
lynx -source %1
scheduled.bat-

then, when you run this script, you can do something like

scheduled http://yourscript

and it will hit that page with lynx, and grab the source. now, using the
windows scheduled service thing (My Computer | Control Panel | Scheduled
Tasks ) you *should* be able to schedule this batch file to run whenever you
want, with the parameter (webpage) you want it to hit.

OK, i just checked and tested (jeez i'm a nice guy.. :P) and dodgy Windoze
schedule doesn't allow you to do it by the hour, so if you want it every 2
hours, you'll have to set one, daily at 2am, one daily at 4am etc etc, all
doing the same thing.

in the Run: box, you can do something like this (my line exactly)
C:\scheduled.bat http://www.dentedreality.com.au

which will run the batch file, and hit that webpage.

P.S. if you wanted to be really tricky, make the PHP script do some output
*not* in html, so just something like


Backup @ 2001-07-05 12:02:34
Operation Successful

or whatever, then rather than 

lynx -source %1

in the batch file, do something like

lynx -source %1  c:\backup_log.txt

which would append the output of the php script continuously to the same
file

ENJOY!

beau


// -Original Message-
// From: PHPFAN [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 6 July 2001 10:20 AM
// To: [EMAIL PROTECTED]
// Subject: Re: [PHP-DB] Newbie:Backend scripts
// 
// 
// Hello Beau Lebens,
// 
// Thank you very much for the advice.
// I am using windows 2000/NT.So do you happen to know how to 
// handle it in
// windows?
// 
// Sagil.
// 
// 
// Beau Lebens [EMAIL PROTECTED] wrote in message
// [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
//  Sagil,
//  the way I do something like this is write a script using 
// PHP that does
//  exactly what you want, without any input or anything like 
// that, then just
//  set up cron to run that script every 2 hours. you can use 
// either lynx to
// hit
//  it as a webpage, or it's an admin script or something that 
// you don't want
//  other people to be able to hit (because it'd be in the 
// web-root) then you
//  can put it outside the documentroot and use the php cgi to run it.
// 
//  if you use lynx, do something like this in your crontab entry (the
// 'timing'
//  might be wrong)
// 
//  * 2,4,6,8,10,12 * * * lynx -source
//  http://yourscript  /dev/null
// 
//  that will just get the source of the page, then pipe it to 
// the 'bin' so to
//  speak, but in doing this, it will perform whatever 
// operations you have
// told
//  it to in the script
// 
//  HTH
// 
//  Beau
// 
//  // -Original Message-
//  // From: PHPFAN [mailto:[EMAIL PROTECTED]]
//  // Sent: Friday, 6 July 2001 9:43 AM
//  // To: [EMAIL PROTECTED]
//  // Subject: [PHP-DB] Newbie:Backend scripts
//  //
//  //
//  // Hi,
//  //
//  // I am using php4 with mssql backend loaded on windows 2000.
//  //
//  // Here is my problem:
//  //
//  // I want to update my database contents every 2 hours 
// with some sql
//  // statements.
//  // Is there anyway I can write scripts in php and run them
//  // every 2 hours?
//  // Anyother solutions are most welcome.
//  //
//  // Thank You,
//  // Sagil.
//  //
//  //
//  //
//  // --
//  // PHP Database Mailing List (http://www.php.net/)
//  // To unsubscribe, e-mail: [EMAIL PROTECTED]
//  // For additional commands, e-mail: [EMAIL PROTECTED]
//  // To contact the list administrators, e-mail:
//  // [EMAIL PROTECTED]
//  //
// 
// 
// 
// -- 
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: [EMAIL PROTECTED]
// For additional commands, e-mail: [EMAIL PROTECTED]
// To contact the list administrators, e-mail: 
// [EMAIL PROTECTED]
// 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Newbie:Backend scripts

2001-07-05 Thread Beau Lebens

// OK, i just checked and tested (jeez i'm a nice guy.. :P) and 
// dodgy Windoze
// schedule doesn't allow you to do it by the hour, so if you 
// want it every 2
// hours, you'll have to set one, daily at 2am, one daily at 
// 4am etc etc, all
// doing the same thing.


change this, under the Schedule Advanced settings for the scheduled event
you can

Repeat Task

every x minutes/hours etc, so only need one scheduled event for it all :)

beau

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Newbie:Backend scripts

2001-07-05 Thread PHPFAN

Thank you very much for your help Beau!!!

Sagil.


Beau Lebens [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 // OK, i just checked and tested (jeez i'm a nice guy.. :P) and
 // dodgy Windoze
 // schedule doesn't allow you to do it by the hour, so if you
 // want it every 2
 // hours, you'll have to set one, daily at 2am, one daily at
 // 4am etc etc, all
 // doing the same thing.


 change this, under the Schedule Advanced settings for the scheduled
event
 you can

 Repeat Task

 every x minutes/hours etc, so only need one scheduled event for it all :)

 beau



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]