Re: Transferring files between computers using php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux