LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices


Reply
  Search this Thread
Old 10-24-2013, 09:32 AM   #1
aigberay
LQ Newbie
 
Registered: Aug 2013
Posts: 8

Rep: Reputation: Disabled
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.
 
Old 10-24-2013, 09:45 AM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,454

Rep: Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052Reputation: 2052
Quote:
Originally Posted by aigberay View Post
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.
 
1 members found this post helpful.
Old 10-24-2013, 09:48 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,785

Rep: Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159
Quote:
Originally Posted by aigberay View Post
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.
 
Old 10-24-2013, 01:04 PM   #4
aigberay
LQ Newbie
 
Registered: Aug 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
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.
 
Old 10-24-2013, 01:24 PM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,116
Blog Entries: 10

Rep: Reputation: 1815Reputation: 1815Reputation: 1815Reputation: 1815Reputation: 1815Reputation: 1815Reputation: 1815Reputation: 1815Reputation: 1815Reputation: 1815Reputation: 1815
Quote:
Originally Posted by aigberay View Post
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.

Last edited by rtmistler; 10-24-2013 at 01:26 PM.
 
1 members found this post helpful.
Old 10-24-2013, 01:27 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,785

Rep: Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159Reputation: 4159
Quote:
Originally Posted by aigberay View Post
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???
 
Old 10-24-2013, 07:51 PM   #7
mreff555
Member
 
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 473

Rep: Reputation: Disabled
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
 
Old 10-24-2013, 09:18 PM   #8
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian
Posts: 2,159

Rep: Reputation: 334Reputation: 334Reputation: 334Reputation: 334
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
win32,shell code,shell programming,shell scripting? mr.cracker Linux - Newbie 4 07-12-2013 11:20 PM
LXer: Terminal functions for shell scripting with Shell Curses LXer Syndicated Linux News 0 03-26-2008 11:50 PM
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
teaching shell scripting: cool scripting examples? fax8 Linux - General 1 04-20-2006 04:29 AM
shell interface vs shell scripting? I'm confused jcchenz Linux - Software 1 10-26-2005 03:32 PM


All times are GMT -5. The time now is 05:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration