[Gllug] Accesing files over the network with perl

Gerhardus Geldenhuis gerhardus.geldenhuis at gmail.com
Mon Oct 17 09:15:58 UTC 2005


On 10/17/05, Richard Jones <rich at annexia.org> wrote:
> On Mon, Oct 17, 2005 at 08:54:28AM +0100, Gerhardus Geldenhuis wrote:
> > I can't use NFS and I can't use FTP to copy the files over.
>
> I'm thinking something like this might work for you:
>
>   open PIPE, "ssh remotehost cat /var/log/apache/access_log|";
>
> Of course this depends on setting up ssh keys appropriately.  You
> could even make it a little more secure by having the Perl script run
> as a separate user, and setting up the remote ssh account so that it
> will only run this one 'cat' command (see sshd(8), section
> AUTHORIZED_KEYS FILE FORMAT, subsection command=...).

Thanks for all the replies so far. Security is not an issue here so
setting up ssh keys wont be a problem. I also like Richard's idea the
best but I would have to play around with it first, I only very
recently started using perl.

I only realised after posting that there is an additionaly problem.
The log files are typically 2meg and bigger up to 30meg and there a
lots of them. Log file size in total per machine at the end of the day
can reach 150Mb.

What is probably needed is a major rewrite of my script to do
preproceesing on each machine and just send the most crucial data
accross the network. We need to keep network traffic to a minimum to
allow for other important services to get priority.

Using syslog is out of the question currently.
--
Groete
Gerhardus Geldenhuis
Registered Linux User #193352
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list