Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > Misc
Reload this Page tailing a file on another server
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Misc Any questions or Linux discussion that does not fit in any of the other technical areas.

Reply
 
Thread Tools Display Modes
Old 06-18-2008   #1 (permalink)
Tomthemage
Just Joined!
 
Join Date: Jun 2008
Posts: 2
tailing a file on another server

I'd like to tail a file that's sitting on another server, but simply typing:

tail address.of.server:/file/to/tail >> output

doesn't seem to be doing the trick:

tail: cannot open "address.of.server:/file/to/tail" for reading: No such file or directory

I'm fairly new to bash and linux in general, so how should I form this? I know how to access this file normally, and I CAN do this by just logging onto the server and then typing:

tail /file/to/tail >> output

but I, for whatever reason, want to consolidate everything to one statement, if possible.
Tomthemage is offline   Reply With Quote
Old 06-18-2008   #2 (permalink)
khafa
Linux Enthusiast
 
khafa's Avatar
 
Join Date: Apr 2008
Location: Tokyo, Japan
Posts: 678
hi,

you can use ssh to do this,

Code:
ssh yourlogin@remote_server "tail file_name" >> output_file
Edit- do you wanna create the output_file on the local machine(from where you are running ssh) or on the remote machine? the above command saves the output on the local machine
__________________
Linux and me it's a love story

Last edited by khafa; 06-18-2008 at 02:10 PM. Reason: clarification
khafa is offline   Reply With Quote
Old 06-18-2008   #3 (permalink)
Tomthemage
Just Joined!
 
Join Date: Jun 2008
Posts: 2
The local machine is where I want to place this file.

Thanks a lot, what I'm planning on doing is tailing an SMTP log file, then accessing the output via a Java program, searching to ensure a specific email was sent. I plan on executing the ssh line you gave to make the data more easily accessible to my program.
Tomthemage is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 02:27 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0