[PHP] Using PHP for server utilities

2001-10-25 Thread Scott

Hello-

I am dreading having to break out my perl books, so here is a thought
about using PHP on the server to handle a chore for me.

I have a Linux ftp server that accepts files from a mainframe every
night.  I need to take those files, determine when the transfer is
done and then re-send them to another machine across a wan.  When that
transfer is complete I need to make a new directory (date would be ok)
and move all of the files into that directory, tar them and finally
produce a status page.

Thoughts?  Has anyone tried this with php?  BTW--it has to be automatic
as a cron job.

Thanks in advance.

-Scott

-- 
PHP General 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] Using PHP for server utilities

2001-10-25 Thread Chuck Theobald

Scott,

This seems a pretty elementary task, ATC, though the detection of when the
transfers are done is problematic.  You could use the filesystem functions,
particularly stat(), for assistance.

I run php code as regular programs, not for web-based access, pretty
regularly.  You simply use the shebang on the first line of your file, as
in Perl, etc.

#!/usr/local/bin/php

?
echo hi, i'm a php program!\n;
echo woohoo!!\n;
if (file_exists(public_html)) :
  print you've got a web directory here\n;
else :
  print no public_html, so sad...\n;
  $mk_result = mkdir(public_html, 0755);
  if ($mk_result) :
print i made one for you!\n;
  else :
print i tried, but failed  :-(\n;
  endif;
endif;
?

The rest is left as an exercise for the reader

Cheers,
Chuck


At 7:32 AM -0700 10/25/01, Scott wrote:
Hello-

I am dreading having to break out my perl books, so here is a thought
about using PHP on the server to handle a chore for me.

I have a Linux ftp server that accepts files from a mainframe every
night.  I need to take those files, determine when the transfer is
done and then re-send them to another machine across a wan.  When that
transfer is complete I need to make a new directory (date would be ok)
and move all of the files into that directory, tar them and finally
produce a status page.

Thoughts?  Has anyone tried this with php?  BTW--it has to be automatic
as a cron job.

Thanks in advance.

-Scott

--
PHP General 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]


Chuck Theobald, Technology Manager
ERIC Clearinghouse on Educational Management
5207 University of Oregon, Eugene, OR, 97403-5207
800-438-8841
* 541-346-1662 (voice) * 541-346-2334  (fax) * 541-337-0182 (cell) *
* http://eric.uoregon.edu/ * mailto:[EMAIL PROTECTED] *



-- 
PHP General 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]