php-general Digest 7 Mar 2008 09:59:19 -0000 Issue 5334

Topics (messages 271102 through 271119):

Re: imagerotate
        271102 by: Daniel Brown

Re: CVS Scripts
        271103 by: Richard Lynch
        271104 by: Chris
        271118 by: Adrian Walls

Transferring files between computers using php
        271105 by: Rahul
        271106 by: Chris
        271107 by: Shawn McKenzie
        271108 by: Shawn McKenzie
        271109 by: Zareef Ahmed
        271110 by: Rahul
        271111 by: Zareef Ahmed
        271112 by: Rahul
        271113 by: Chris
        271114 by: Ray Hauge
        271115 by: Shawn McKenzie
        271116 by: Chris
        271117 by: Aschwin Wesselius
        271119 by: Peter Ford

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
On Thu, Mar 6, 2008 at 4:41 PM, tedd <[EMAIL PROTECTED]> wrote:
> At 4:19 PM -0500 3/6/08, Daniel Brown wrote:
>  >     New file: resizeandrotate.php
>
>  It sounds like a phrase we used in high school with a hand gesture.

    I'm familiar with the phrase.  I believe it involved passing an
object to a private function prior to rotation.

-- 
</Dan>

Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>

--- End Message ---
--- Begin Message ---
On Thu, March 6, 2008 10:02 am, Wolf wrote:
>> I am using Zend Studio Server and I haven't upgraded to Zend Studio
>> for
>> Eclipse as yet.  It also has some CVS capability not its not what I
>> am
>> after.
>>
>> Google was my first stop but it didn't turn up anything which
>> appeared to be
>> in a stable enough state.  Hence my email to the list to see if
>> anyone else
>> had come across such a solution.  My application is built from
>> several
>> modules contained with cvs.  Some of these modules are used across
>> projects.
>> I wanted to create my own web-based script to check these out of cvs
>> and to
>> build and configure the application on the fly.
>>
>> I had a look at cruisecontrol but its not really what I am looking
>> for
>> either.
> <!-- SNIP -->
>
> You're probably going to have to code that sucker on your own and
> slide it in as a cron job on your build server to get the
> latest/greatest whenever needed.  I haven't come across anything like
> it before, but I definitely like the concept.

Perhaps something very low-brow simple could work for a short-term
solution, while you code up the fancy internal PHP CVS functions one:

<?php
define('PATH', '/full/path/to/working/copy');
function cvs_checkout($file){
  cd(PATH);
  exec("cd PATH; cvs co $file", $output, $error);
  echo implode("", $output);
  if ($error){
    trigger_user_error("OS Error: $error", E_USER_ERROR);
  }
}
?>

The remaining functions are left as an exercise for the reader. :-)

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?


--- End Message ---
--- Begin Message ---

If you want to ask, and have answered, a question that's important to you, then consider asking it in a way that's respectful. That's understandable, is it not?

He did ask a question.

"I would like to be able to automatically check projects out from a CVS
repository using PHP rather than a traditional CVS client as part of a build
process?  Has anyone done this successfully before and if so can they point
me in the right direction on how to go about this?
"

Out of 20-odd replies, 2 or 3 were actually helpful - the rest were complaining about his signature.

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
Thanks Chris and to everyone else who actually replied with some useful
info, it's much appreciated.  I am going to code this up myself with
wrappers around the cvs commands I need.  It would have been nice if there
was some sort of framework for doing this already.  
 
The reason I joined this list was to try and get some helpful insights not
to face a barrage of emails about my signature.  OK so I sent a message with
a signature I should have stripped out, big deal. Anyway, that's the end of
the matter on the signature from me.

Thanks again to all those who replied with constrictive comments.

Cheers,
Adrian.



-----Original Message-----
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: 07 March 2008 00:40
To: tedd
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] CVS Scripts


> If you want to ask, and have answered, a question that's important to 
> you, then consider asking it in a way that's respectful. That's 
> understandable, is it not?

He did ask a question.

"I would like to be able to automatically check projects out from a CVS
repository using PHP rather than a traditional CVS client as part of a build
process?  Has anyone done this successfully before and if so can they point
me in the right direction on how to go about this?
"

Out of 20-odd replies, 2 or 3 were actually helpful - the rest were 
complaining about his signature.

-- 
Postgresql & php tutorials
http://www.designmagick.com/

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



--- End Message ---
--- Begin Message ---
I have a small file to be transferred between two computers every few 
seconds. I'm using unix with a bare bones version of php, i.e. just the 
original thing that gets installed when I run "yum install php". As there is 
no webserver on any of these machines, I was wondering if there is a way to 
transfer a small file between them and if there is, could someone be kind 
enough to provide me with an example please?

Thank You 



--- End Message ---
--- Begin Message ---
Rahul wrote:
I have a small file to be transferred between two computers every few seconds. I'm using unix with a bare bones version of php, i.e. just the original thing that gets installed when I run "yum install php". As there is no webserver on any of these machines, I was wondering if there is a way to transfer a small file between them and if there is, could someone be kind enough to provide me with an example please?

Don't use php, use rsync (http://rsync.samba.org/).

It's fast, only transfers differences between the files, can work via an ssh connection etc...

I guess you could also use a samba or an nfs mounted drive, but that may depend on whether the machines are in a local environment or not (I certainly wouldn't do it across an open internet connection, only via a LAN connection).

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
Rahul wrote:
> I have a small file to be transferred between two computers every few 
> seconds. I'm using unix with a bare bones version of php, i.e. just the 
> original thing that gets installed when I run "yum install php". As there is 
> no webserver on any of these machines, I was wondering if there is a way to 
> transfer a small file between them and if there is, could someone be kind 
> enough to provide me with an example please?
> 
> Thank You 
> 
> 
This is much easier using unix/linux commands than using php.  Any
reason for using php instead of scp /path/file [EMAIL PROTECTED]:/path/ or other
facilities?

-Shawn

--- End Message ---
--- Begin Message ---
Rahul wrote:
> I have a small file to be transferred between two computers every few 
> seconds. I'm using unix with a bare bones version of php, i.e. just the 
> original thing that gets installed when I run "yum install php". As there is 
> no webserver on any of these machines, I was wondering if there is a way to 
> transfer a small file between them and if there is, could someone be kind 
> enough to provide me with an example please?
> 
> Thank You 
> 
> 
FYI...  If you're using yum I assume it's a Linux machine (maybe Fedora)
and not Unix.

--- End Message ---
--- Begin Message ---
On 3/7/08, Shawn McKenzie <[EMAIL PROTECTED]> wrote:
>
> Rahul wrote:
> > I have a small file to be transferred between two computers every few
> > seconds. I'm using unix with a bare bones version of php, i.e. just the
> > original thing that gets installed when I run "yum install php". As
> there is
> > no webserver on any of these machines, I was wondering if there is a way
> to
> > transfer a small file between them and if there is, could someone be
> kind
> > enough to provide me with an example please?
> >
> > Thank You
> >
> >
>
> FYI...  If you're using yum I assume it's a Linux machine (maybe Fedora)
> and not Unix.



If you want to use rsync and scp in a cronjob (for continuous transfer at a
predefined interval), you may need to set your server (read ssh) to accept
connection without password.
Ref : http://linuxproblem.org/art_9.html

BUT If you really want to do that from PHP, you can install a web server and
enable http as your stream for opening files. (In php.ini)
 You can read the file using fopen or any other file functions, then can
write that file to the server on which script will be running, then you can
set this script as your cron job.

For example :

$filecontents=file_get_contents("http://firstserver/file.txt";);

$fp=fopen("path to local file", "mode");

Now use $fiiecontents to write the file using $fp resource.

BUT remember, using rsync is always a better solution, and file_get_contents
and file functions are resource hungry, specially they will consume more
memory of your system.



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


-- 
Zareef Ahmed
http://www.zareef.net
A PHP Developer in India

--- End Message ---
--- Begin Message --- Thank you all so much for replying... I guess I was very vague in describing the situation. I will write in detail:

I have three computers A, B and C. To login to B and C I should use A because it has a SSH key. I don't have any other way of accessing these two computers. Now, if I need to transfer a file between B and C, I am unable to find a way that would work... because I don't know how to authenticate without SSH keys... I was gathering some data in B and C using PHP. Now, I need these two computers to coordinate a little and didn't want to use a server in between and so I was thinking of establishing a direct connection between them..


Zareef Ahmed wrote:
On 3/7/08, Shawn McKenzie <[EMAIL PROTECTED]> wrote:
Rahul wrote:
I have a small file to be transferred between two computers every few
seconds. I'm using unix with a bare bones version of php, i.e. just the
original thing that gets installed when I run "yum install php". As
there is
no webserver on any of these machines, I was wondering if there is a way
to
transfer a small file between them and if there is, could someone be
kind
enough to provide me with an example please?

Thank You


FYI...  If you're using yum I assume it's a Linux machine (maybe Fedora)
and not Unix.



If you want to use rsync and scp in a cronjob (for continuous transfer at a
predefined interval), you may need to set your server (read ssh) to accept
connection without password.
Ref : http://linuxproblem.org/art_9.html

BUT If you really want to do that from PHP, you can install a web server and
enable http as your stream for opening files. (In php.ini)
 You can read the file using fopen or any other file functions, then can
write that file to the server on which script will be running, then you can
set this script as your cron job.

For example :

$filecontents=file_get_contents("http://firstserver/file.txt";);

$fp=fopen("path to local file", "mode");

Now use $fiiecontents to write the file using $fp resource.

BUT remember, using rsync is always a better solution, and file_get_contents
and file functions are resource hungry, specially they will consume more
memory of your system.



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




--- End Message ---
--- Begin Message ---
On 3/7/08, Rahul <[EMAIL PROTECTED]> wrote:
>
> Thank you all so much for replying... I guess I was very vague in
> describing the situation. I will write in detail:
>
> I have three computers A, B and C. To login to B and C I should use A
> because it has a SSH key. I don't have any other way of accessing these
> two computers. Now, if I need to transfer a file between B and C, I am
> unable to find a way that would work... because I don't know how to
> authenticate without SSH keys... I was gathering some data in B and C
> using PHP. Now, I need these two computers to coordinate a little and
> didn't want to use a server in between and so I was thinking of
> establishing a direct connection between them..


If you have ruled out web server and ssh, then you can use ftp using PHP or
use NFS mounting.




Zareef Ahmed wrote:
> > On 3/7/08, Shawn McKenzie <[EMAIL PROTECTED]> wrote:
> >> Rahul wrote:
> >>> I have a small file to be transferred between two computers every few
> >>> seconds. I'm using unix with a bare bones version of php, i.e. just
> the
> >>> original thing that gets installed when I run "yum install php". As
> >> there is
> >>> no webserver on any of these machines, I was wondering if there is a
> way
> >> to
> >>> transfer a small file between them and if there is, could someone be
> >> kind
> >>> enough to provide me with an example please?
> >>>
> >>> Thank You
> >>>
> >>>
> >> FYI...  If you're using yum I assume it's a Linux machine (maybe
> Fedora)
> >> and not Unix.
> >
> >
> >
> > If you want to use rsync and scp in a cronjob (for continuous transfer
> at a
> > predefined interval), you may need to set your server (read ssh) to
> accept
> > connection without password.
> > Ref : http://linuxproblem.org/art_9.html
> >
> > BUT If you really want to do that from PHP, you can install a web server
> and
> > enable http as your stream for opening files. (In php.ini)
> >  You can read the file using fopen or any other file functions, then can
> > write that file to the server on which script will be running, then you
> can
> > set this script as your cron job.
> >
> > For example :
> >
> > $filecontents=file_get_contents("http://firstserver/file.txt";);
> >
> > $fp=fopen("path to local file", "mode");
> >
> > Now use $fiiecontents to write the file using $fp resource.
> >
> > BUT remember, using rsync is always a better solution, and
> file_get_contents
> > and file functions are resource hungry, specially they will consume more
> > memory of your system.
> >
> >
> >
> > --
> >> 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
>
>


-- 
Zareef Ahmed
http://www.zareef.net
A PHP Developer in India

--- End Message ---
--- Begin Message ---
Zareef Ahmed wrote:
On 3/7/08, Rahul <[EMAIL PROTECTED]> wrote:
Thank you all so much for replying... I guess I was very vague in
describing the situation. I will write in detail:

I have three computers A, B and C. To login to B and C I should use A
because it has a SSH key. I don't have any other way of accessing these
two computers. Now, if I need to transfer a file between B and C, I am
unable to find a way that would work... because I don't know how to
authenticate without SSH keys... I was gathering some data in B and C
using PHP. Now, I need these two computers to coordinate a little and
didn't want to use a server in between and so I was thinking of
establishing a direct connection between them..


If you have ruled out web server and ssh, then you can use ftp using PHP or
use NFS mounting.




Zareef Ahmed wrote:
On 3/7/08, Shawn McKenzie <[EMAIL PROTECTED]> wrote:
Rahul wrote:
I have a small file to be transferred between two computers every few
seconds. I'm using unix with a bare bones version of php, i.e. just
the
original thing that gets installed when I run "yum install php". As
there is
no webserver on any of these machines, I was wondering if there is a
way
to
transfer a small file between them and if there is, could someone be
kind
enough to provide me with an example please?

Thank You


FYI...  If you're using yum I assume it's a Linux machine (maybe
Fedora)
and not Unix.


If you want to use rsync and scp in a cronjob (for continuous transfer
at a
predefined interval), you may need to set your server (read ssh) to
accept
connection without password.
Ref : http://linuxproblem.org/art_9.html

BUT If you really want to do that from PHP, you can install a web server
and
enable http as your stream for opening files. (In php.ini)
 You can read the file using fopen or any other file functions, then can
write that file to the server on which script will be running, then you
can
set this script as your cron job.

For example :

$filecontents=file_get_contents("http://firstserver/file.txt";);

$fp=fopen("path to local file", "mode");

Now use $fiiecontents to write the file using $fp resource.

BUT remember, using rsync is always a better solution, and
file_get_contents
and file functions are resource hungry, specially they will consume more
memory of your system.



--
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




Well I haven't ruled our webserver and ssh but I don't have much options. Number 1 is that I have many such computers and I don't think I can afford to install a webserver on all of them atleast. And coming to SSH, I can't use it because of the scenario that I explained. Please let me know if you have any other advice.

Thank You

--- End Message ---
--- Begin Message ---
Rahul wrote:
Thank you all so much for replying... I guess I was very vague in describing the situation. I will write in detail:

I have three computers A, B and C. To login to B and C I should use A because it has a SSH key. I don't have any other way of accessing these two computers. Now, if I need to transfer a file between B and C, I am unable to find a way that would work... because I don't know how to authenticate without SSH keys... I was gathering some data in B and C using PHP. Now, I need these two computers to coordinate a little and didn't want to use a server in between and so I was thinking of establishing a direct connection between them..

You can use ssh key forwarding on b & c - so when you log in to a, they accept the key straight away.

Or set up passwordless ssh between b & c.

http://blogs.translucentcode.org/mick/archives/000230.html

Though this:
chmod 644 ~/.ssh/authorized_keys

should probably be:

chmod 600 ~/.ssh/authorized_keys

so nobody else can even read the file.

and I always:

chmod 700 ~/.ssh

Not much in here related to php though :P

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
Rahul wrote:
Zareef Ahmed wrote:
On 3/7/08, Rahul <[EMAIL PROTECTED]> wrote:
Thank you all so much for replying... I guess I was very vague in
describing the situation. I will write in detail:

I have three computers A, B and C. To login to B and C I should use A
because it has a SSH key. I don't have any other way of accessing these
two computers. Now, if I need to transfer a file between B and C, I am
unable to find a way that would work... because I don't know how to
authenticate without SSH keys... I was gathering some data in B and C
using PHP. Now, I need these two computers to coordinate a little and
didn't want to use a server in between and so I was thinking of
establishing a direct connection between them..


If you have ruled out web server and ssh, then you can use ftp using PHP or
use NFS mounting.




Zareef Ahmed wrote:
On 3/7/08, Shawn McKenzie <[EMAIL PROTECTED]> wrote:
Rahul wrote:
I have a small file to be transferred between two computers every few
seconds. I'm using unix with a bare bones version of php, i.e. just
the
original thing that gets installed when I run "yum install php". As
there is
no webserver on any of these machines, I was wondering if there is a
way
to
transfer a small file between them and if there is, could someone be
kind
enough to provide me with an example please?

Thank You


FYI...  If you're using yum I assume it's a Linux machine (maybe
Fedora)
and not Unix.


If you want to use rsync and scp in a cronjob (for continuous transfer
at a
predefined interval), you may need to set your server (read ssh) to
accept
connection without password.
Ref : http://linuxproblem.org/art_9.html

BUT If you really want to do that from PHP, you can install a web server
and
enable http as your stream for opening files. (In php.ini)
You can read the file using fopen or any other file functions, then can
write that file to the server on which script will be running, then you
can
set this script as your cron job.

For example :

$filecontents=file_get_contents("http://firstserver/file.txt";);

$fp=fopen("path to local file", "mode");

Now use $fiiecontents to write the file using $fp resource.

BUT remember, using rsync is always a better solution, and
file_get_contents
and file functions are resource hungry, specially they will consume more
memory of your system.



--
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




Well I haven't ruled our webserver and ssh but I don't have much options. Number 1 is that I have many such computers and I don't think I can afford to install a webserver on all of them atleast. And coming to SSH, I can't use it because of the scenario that I explained. Please let me know if you have any other advice.

Thank You


I second the NFS mounting. You can share a directory somewhere on computer A. Then computers B and C connect to it. That way with PHP you just copy the file to the shares, and computers B and C automatically see the file there. Outside of that FTP might work well for you. Maybe even SCP, since you already have the keys on server A (as long as you don't have a password when connecting to B or C). rsync can work over SSH as well, and you could create a simple script to run rsync as often as you need.

haha, I guess that's not exactly seconding NFS, more seconding not transferring files over HTTP.

--
Ray Hauge
www.primateapplications.com

--- End Message ---
--- Begin Message ---
Rahul wrote:
> Thank you all so much for replying... I guess I was very vague in
> describing the situation. I will write in detail:
> 
> I have three computers A, B and C. To login to B and C I should use A
> because it has a SSH key. I don't have any other way of accessing these
> two computers. Now, if I need to transfer a file between B and C, I am
> unable to find a way that would work... because I don't know how to
> authenticate without SSH keys... I was gathering some data in B and C
> using PHP. Now, I need these two computers to coordinate a little and
> didn't want to use a server in between and so I was thinking of
> establishing a direct connection between them..
> 
> 
> Zareef Ahmed wrote:
>> On 3/7/08, Shawn McKenzie <[EMAIL PROTECTED]> wrote:
>>> Rahul wrote:
>>>> I have a small file to be transferred between two computers every few
>>>> seconds. I'm using unix with a bare bones version of php, i.e. just the
>>>> original thing that gets installed when I run "yum install php". As
>>> there is
>>>> no webserver on any of these machines, I was wondering if there is a
>>>> way
>>> to
>>>> transfer a small file between them and if there is, could someone be
>>> kind
>>>> enough to provide me with an example please?
>>>>
>>>> Thank You
>>>>
>>>>
>>> FYI...  If you're using yum I assume it's a Linux machine (maybe Fedora)
>>> and not Unix.
>>
>>
>>
>> If you want to use rsync and scp in a cronjob (for continuous transfer
>> at a
>> predefined interval), you may need to set your server (read ssh) to
>> accept
>> connection without password.
>> Ref : http://linuxproblem.org/art_9.html
>>
>> BUT If you really want to do that from PHP, you can install a web
>> server and
>> enable http as your stream for opening files. (In php.ini)
>>  You can read the file using fopen or any other file functions, then can
>> write that file to the server on which script will be running, then
>> you can
>> set this script as your cron job.
>>
>> For example :
>>
>> $filecontents=file_get_contents("http://firstserver/file.txt";);
>>
>> $fp=fopen("path to local file", "mode");
>>
>> Now use $fiiecontents to write the file using $fp resource.
>>
>> BUT remember, using rsync is always a better solution, and
>> file_get_contents
>> and file functions are resource hungry, specially they will consume more
>> memory of your system.
>>
>>
>>
>> -- 
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
If ssh keys are installed on the remote hosts then scp works
transparently and you just stick the scp in a cron job.  Am I missing
something?

-Shawn

--- End Message ---
--- Begin Message ---

If ssh keys are installed on the remote hosts then scp works
transparently and you just stick the scp in a cron job.  Am I missing
something?

Yeh - looks like you have to log in to "A" and then it uses key-forwarding to let you log in to "B" and "C":

---
To login to B and C I should use A because it has a SSH key. I don't have any other way of accessing these two computers.
---

ie B & C can't talk to each other directly (that's my understanding anyway).

--
Postgresql & php tutorials
http://www.designmagick.com/

--- End Message ---
--- Begin Message ---
Rahul wrote:
I have a small file to be transferred between two computers every few seconds. I'm using unix with a bare bones version of php, i.e. just the original thing that gets installed when I run "yum install php". As there is no webserver on any of these machines, I was wondering if there is a way to transfer a small file between them and if there is, could someone be kind enough to provide me with an example please?

Thank You

You can use netcat (nc), but that doesn't run in daemon mode. You can use them both ways (client / server, sending / receiving). You can use them on the commandline with a cronjob or whatever.

Netcat makes it possible to do this, to send content over to port 2200 of 192.168.1.1:

cat textfile.txt | nc 192.168.1.1 2200

On 192.168.1.1 all you do is something like this:

nc -l -p 2200 > textfile.txt

I don't know all the options in depth and may not work like scp does (which is way more secure).

So I would go with scp in a cronjob, but netcat is still an option.


--
Aschwin Wesselius

<social>

What you would like to be done to you, do that to the other....

</social>



--- End Message ---
--- Begin Message ---
Aschwin Wesselius wrote:
> Rahul wrote:
>> I have a small file to be transferred between two computers every few
>> seconds. I'm using unix with a bare bones version of php, i.e. just
>> the original thing that gets installed when I run "yum install php".
>> As there is no webserver on any of these machines, I was wondering if
>> there is a way to transfer a small file between them and if there is,
>> could someone be kind enough to provide me with an example please?
>>
>> Thank You 
> 
> You can use netcat (nc), but that doesn't run in daemon mode. You can
> use them both ways (client / server, sending / receiving). You can use
> them on the commandline with a cronjob or whatever.
> 
> Netcat makes it possible to do this, to send content over to port 2200
> of 192.168.1.1:
> 
> cat textfile.txt | nc 192.168.1.1 2200
> 
> On 192.168.1.1 all you do is something like this:
> 
> nc -l -p 2200 > textfile.txt
> 
> I don't know all the options in depth and may not work like scp does
> (which is way more secure).
> 
> So I would go with scp in a cronjob, but netcat is still an option.
> 
> 

Here's overkill: use "fuse" to make two sshfs filesystems :)

# Make some directories to mount the remote stuff onto
mkdir -p mount_point_for_B
mkdir -p mount_point_for_C

# Use 'fuse' to make SSHFS mounts from the remotes to the new directories
sshfs B:/path_to_where_the_file_is    mount_point_for_B
sshfs C:/path_to_where_the_file_goes  mount_point_for_C

# Copy the file across: repeat this step every few seconds (cron job?)
cp mount_point_for_B/the_file_to_copy   mount_point_for_C

# Unmount the SSHFS mounts when you're finished
fusermount -u mount_point_for_B
fusermount -u mount_point_for_C


Still not PHP though...



-- 
Peter Ford                              phone: 01580 893333
Developer                               fax:   01580 893399
Justcroft International Ltd., Staplehurst, Kent

--- End Message ---

Reply via email to