Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I've come here to ask for some guidance regarding a shell script ( I am very new to this )
I would like to create the following:
A Script that runs on a "logger" box.
This script does the following:
It logs into multiple servers (about 5-6 may have to add more in the future)
and does the following:
It would log into these boxes and change to a certain directory which contain jboss logs; these logs would need to be compressed .tar.gz with a date appending to them so basically .log >> 20120716-log.tar.gz and then the logs would need to be shot across from that server to the "logger" box to a certain directory depending on the server name
so for example
Logger Box does this for SISP1 > the log is made than shot to Logger box under /archives/sisp1/
I would need this to happen for the 4 others (sisp1,2,3,4,5) to the appropriate directory on the logger box.
I know I need to set up keys/ known host, but cant really visualize the rest of the script.
could someone give me an example script or something I could look at for location..
All of the actual log files on the remote boxes (sisp1,2,3,4) are all in the same destination on each box.
Please let me know if I could provide any further details.
The basic approach is to set up passwordless login via SSH keys. Then your script should be straight forward. One SSH command to create the tarball, one SCP command to copy it locally. Where are you running into problems?
Ok ,well you should first tell your teacher that using the right tool for the job is, in my opinion, the #1 rule to live by as a system admin.
Since, you have to use a script you can do a cron with ssh/tar as suicidaleggroll suggested. Commandlinefu.com has some examples you can reference, a few are below to help get you in the right direction.
Keep in mind though that we aren't going to write it for you, let us know what you have done, where you are having issues and, if you can, provide some of your code so we can give you some pointers.
ssh user@host "tar -zcf - /path/to/dir" > dir.tar.gz # Would create a tarball remotely
ssh 127.0.0.1 'tar zxvf files.tar.gz -C ~/test/' # would extract a tarball remotely