LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Shell Scripting Issues (https://www.linuxquestions.org/questions/linux-newbie-8/shell-scripting-issues-4175482079/)

aigberay 10-24-2013 09:32 AM

Shell Scripting Issues
 
I have three production servers, like A, B and C where A is the home directory, i need a script to compare the contents of A to B and C and subsequently email the difference. I will appreciate any help i can get on this.

suicidaleggroll 10-24-2013 09:45 AM

Quote:

Originally Posted by aigberay (Post 5051517)
I have three production servers, like A, B and C where A is the home directory, i need a script to compare the contents of A to B and C and subsequently email the difference. I will appreciate any help i can get on this.

You'd get more/better responses if you put this question in its own thread, since it has absolutely nothing to do with the original question.

TB0ne 10-24-2013 09:48 AM

Quote:

Originally Posted by aigberay (Post 5051517)
I have three production servers, like A, B and C where A is the home directory, i need a script to compare the contents of A to B and C and subsequently email the difference. I will appreciate any help i can get on this.

We'll be glad to help...so post what you've written/tried so far, and tell us where you're stuck. But you don't provide any real details here, such as what you're trying to compare (quantity, location, etc.), how you want to perform the check, etc.

If all you're looking to do is compare file names and spot differences, then just do a "find /some/path -type f > filename", then you can grab that file with rsync, scp, etc., and just run a diff on them.

aigberay 10-24-2013 01:04 PM

Need some help on this one
 
I have three production servers, like A, B and C where A is the home directory, i need a script to compare the contents (list of file names and location)of A to B and C and subsequently email the difference. I will appreciate any help i can get on this.

rtmistler 10-24-2013 01:24 PM

Quote:

Originally Posted by aigberay (Post 5051637)
I have three production servers, like A, B and C where A is the home directory, i need a script to compare the contents (list of file names and location)of A to B and C and subsequently email the difference. I will appreciate any help i can get on this.

All I have to say is "Wow! You don't listen."

1.) Give it an attempt and post your attempt. Look towards info on how to ask a question and recommendations for what to do when including code in your posts.

Copied from TBone's signature:

https://www.linuxquestions.org/linux...Ask_a_Question

2.) When creating your attempt. "Think" about how you'd do that normally. I.e. you'd get the directory listing of all, and then difference them. Well ... script that using the most basic commands and then add features as you need them, or if you discover problems, post your attempt, and present your problem(s) clearly so that people can help you, and will be willing to help you.

3.) Remember that this is a forum of volunteers. No one is required to answer questions, but they do so to help you learn.

TB0ne 10-24-2013 01:27 PM

Quote:

Originally Posted by aigberay (Post 5051637)
I have three production servers, like A, B and C where A is the home directory, i need a script to compare the contents (list of file names and location)of A to B and C and subsequently email the difference. I will appreciate any help i can get on this.

Yes, we know this. Asking the EXACT SAME QUESTION a second time doesn't get you answers faster (or at all). Did you not read/understand what was told to you???

mreff555 10-24-2013 07:51 PM

So, I didn't even get to the bottom of the post and I'm already annoyed. You you really should try advice given if you are going to continue to ask for it.

However, If you need a solution spelled out for you, a quick google search found someone with the same problem, who seems to have found a solution.

http://nixcraft.com/showthread.php/1...e-it-exceed-75

haertig 10-24-2013 09:18 PM

If you're trying to monitor systems, why reinvent the wheel? Look into the multitude of free/opensource monitoring tools that are available. Personally, I like Xymon (used to be called Hobbit). But there are a ton of others.

But, if instead you are doing a homework assignment here, many folks will be more willing to help you if you try it yourself and then ask questions regarding the areas where you have stumbled. A blatant request to "do my homework for me" doesn't often get many responses.

This has "homework assignment" written all over it as I see things, and I think others probably do as well, and that may be the reason why you haven't seen the solution (which is very simple) laid out for you ready-to-turn-in-for-class. Give it a shot yourself. Post what you've done. Point out where you're having problems and some specific questions you have, and I'll bet the help from the LQ.org community starts rolling in.


All times are GMT -5. The time now is 06:16 AM.