Re: [PHP] Crontab for Windows

2005-02-18 Thread Jochem Maas
bob wrote:
Hi,
I am trying to schedule the running of some PHP scripts on my Win2K PC 
at home.

On my live server I use Linux, so am fully familiar with Crontab. I am 
not that familiar with running scripts using the scheduler in Win2K though.

So far what I have is:
C:\php\php.exe -q c:\path\to\php\file.php
what happens if you quote everything?:
C:\php\php.exe -q c:\path\to\php\file.php
But this doesn't seem to do anything..the task manager in the windows 
scheduler just keeps saying that the task has not been run.

Any suggestions?
Also, one thing I would like my script to do is to send out an email, 
but I don't have a mail server set up on my home PC..is there anyway to 
run a script from a server on a different machine, using Windows 
scheduler, and if so, what form would the 'path' to the file/server take?

Many thanks
Alexis
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Crontab for Windows

2005-02-18 Thread pjn
On W3K you could use this as the run line in
Scheduled Tasks and probably the same in XP
although I have not tested this. The same
components exist in the W2K version although
may be in different locations/names.
Run: cmd /c c:\php\php.exe -q c:\path\to\php\file.php
Start in: C:\path\to\php\file\
Run as: username/pass with security acess to
both php.exe and the file.php
YMMV
pjn
- Original Message - 
From: Jochem Maas [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Friday, February 18, 2005 10:06 PM
Subject: Re: [PHP] Crontab for Windows


bob wrote:
Hi,
I am trying to schedule the running of some PHP scripts on my Win2K PC at 
home.

On my live server I use Linux, so am fully familiar with Crontab. I am 
not that familiar with running scripts using the scheduler in Win2K 
though.

So far what I have is:
C:\php\php.exe -q c:\path\to\php\file.php
what happens if you quote everything?:
C:\php\php.exe -q c:\path\to\php\file.php
But this doesn't seem to do anything..the task manager in the windows 
scheduler just keeps saying that the task has not been run.

Any suggestions?
Also, one thing I would like my script to do is to send out an email, but 
I don't have a mail server set up on my home PC..is there anyway to run a 
script from a server on a different machine, using Windows scheduler, and 
if so, what form would the 'path' to the file/server take?

Many thanks
Alexis
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Crontab for Windows

2005-02-18 Thread Jason Barnett
[EMAIL PROTECTED] wrote:
 On W3K you could use this as the run line in
 Scheduled Tasks and probably the same in XP
 although I have not tested this. The same
 components exist in the W2K version although
 may be in different locations/names.
 
 Run: cmd /c c:\php\php.exe -q c:\path\to\php\file.php

This is *very* close to what I use with Windows XP (actually I use this
for file types so that I can right click and run a PHP file on the
command line).

cmd /K C:\php\php.exe -f %1

The %1 is a variable that gets replaced.  If you set this up for the
file type then the %1 is the name of the file.

So to apply this knowledge to scheduled tasks, you can do:
cmd /K C:\php\php.exe -f C:\path\to\your\file.php

 
 Start in: C:\path\to\php\file\
 
 Run as: username/pass with security acess to
 both php.exe and the file.php

Agreed... it is much easier to manage it this way although it is
*possible* to use the command runas to execute PHP as a different user.

For help on these commands, just use:
cmd /?
runas /?

 
 YMMV
 
 pjn
 


-- 
Teach a man to fish...

NEW? | http://www.catb.org/~esr/faqs/smart-questions.html
STFA | http://marc.theaimsgroup.com/?l=php-generalw=2
STFM | http://www.php.net/manual/en/index.php
STFW | http://www.google.com/search?q=php
LAZY |
http://mycroft.mozdev.org/download.html?name=PHPsubmitform=Find+search+plugins


signature.asc
Description: OpenPGP digital signature


RE: [PHP] Crontab for Windows

2005-02-17 Thread Warren Vail
 On my live server I use Linux, so am fully familiar with Crontab. I am
 not that familiar with running scripts using the scheduler in
 Win2K though.

I use nncronlite which is a cron implementation for windoz (familiar
crot.tab file);

http://www.batchconverter.com/nnCronLITE-download-16062.shtml

One problem I encountered with the MS scheduler, is it needed to be running
as a process, and in an implementation of windows that had Microsoft SQL
Server running on NT, seems this SQL server has the ability to schedule some
batch processes, but it implemented a replacement for the batch scheduler
that would not process my AT commands.  In windoz the AT command is used
to add processes to the schedule.

hope this helps,

Warren Vail

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Crontab for Windows

2005-02-17 Thread Richard Lynch
bob wrote:
 C:\php\php.exe -q c:\path\to\php\file.php

 But this doesn't seem to do anything..the task manager in the windows
 scheduler just keeps saying that the task has not been run.

 Any suggestions?

The Task Scheduler uses the 'at' command under the hood, same as cron...

Perhaps if you dig down into your 'at' command and see if it's broken...

 Also, one thing I would like my script to do is to send out an email,
 but I don't have a mail server set up on my home PC..is there anyway to
 run a script from a server on a different machine, using Windows
 scheduler, and if so, what form would the 'path' to the file/server take?

If a full-fledged SMTP server is too much hassle, and you're looking to
send a relatively light load of email, I've been told that the Pegasus
email client is quite happy and easily run from a command line to send out
mail under Windows.  YMMV

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php