Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open file from another machine

Status
Not open for further replies.

CristianLuca

Programmer
Oct 25, 2007
36
RO
Hello again,
What is the most efficient way to open a file through network ? Considering that i'm writting a cron that from 10 to 10 minutes logs on several machines [1-10] and gets some log
file. ( like 16-265 log files per machine )

Thank you in advance,
Cristian
 
[opinion]
There is probably isn't that much difference between the different options that are probably available to you.
[/opinion]
FTP/RCP/SCP. We move massive amounts of data around using FTP and SCP.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
Thanks, i do not know how to open a file through network, so i was wondering what was the best way to do that.
 
Oh.. I was assuming you were copying it back and opening it. Are you trying to grep through the logs or something?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
this is my logic :

foreach machineName (machineNames) { # $# machineNames = [0-15]
foreach fileName (fileNames) # $#fileNames = [0-255]
open(machineName::FH,>$fileName)
#read something from machine::FH
}
}

i could just simply copy the file to my machine using scp, but that's useless , since i'm just looking for greping the last input rom each file
 
Why not do it the other way around? Write a script that takes the last line from each file that runs on the same machine the files are located on. Then transfer the result to wherever you're centrally processing them via SCP.
 
Assuming you are on a UNIX/Linux machine. You can try the tail command using ssh:

ssh hostname tail -1 /path/to/file

Note: You will have to add public key to your environments for scripting functionality.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top