LinuxQuestions.org
Visit Jeremy's Blog.
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 04-13-2012, 09:08 AM   #1
Ajit Gunge
Member
 
Registered: Jan 2008
Location: Pune
Distribution: RHEL,fedora
Posts: 253
Blog Entries: 1

Rep: Reputation: 21
Question How can I do the follwoing task?


I have a situation here.This is what I want to do and I dont know how to go about doing this.

I have a request from a user say "A takle "; "B datya" stating that they want themselves to be removed from a certain mailing list say "teen takle 1212]".
I have access to the server but I dont know what script sends this particular mail to the user.All I know is the user name and the subject of the mail and the mail details.Now I have the following issues.

1.)How do I find the script that actually sends the mail.
2.)How do I search for the user teen takle in all the files and folders on the server.

Can someone tell me how do I proceed about doing this?

Thanks,

Last edited by Ajit Gunge; 04-23-2012 at 03:21 AM.
 
Old 04-13-2012, 09:27 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
It might take a long time traversing all the directory tree and greppin' all the files. You can try to restrict the search by excluding some directories and use the proper options of grep to ignore binary files. Here is an example:
Code:
find / \( -wholename /etc -o -wholename /usr -o -wholename /tmp -o -wholename /var -o -wholename /proc \) -prune -o -type f -exec grep -i -HI "A takle" {} \;
I don't know if you're familiar with the -prune predicate of find. Anyway, you can add/remove more
Code:
-wholename /some/path
expressions inside the escaped parentheses and separated by the logical operator -o in order to exclude or include more system directories. For an explanation of -prune, you can take a look at this post, self-citation, I know...

Hope this helps!

Last edited by colucix; 04-23-2012 at 06:34 AM.
 
1 members found this post helpful.
Old 04-17-2012, 01:07 AM   #3
Ajit Gunge
Member
 
Registered: Jan 2008
Location: Pune
Distribution: RHEL,fedora
Posts: 253
Blog Entries: 1

Original Poster
Rep: Reputation: 21
Question Still stuck,

Quote:
Originally Posted by colucix View Post
It might take a long time traversing all the directory tree and greppin' all the files. You can try to restrict the search by excluding some directories and use the proper options of grep to ignore binary files. Here is an example:
Code:
find / \( -wholename /etc -o -wholename /usr -o -wholename /tmp -o -wholename /var -o -wholename /proc \) -prune -o -type f -exec grep -i -HI "A takle" {} \;
I don't know if you're familiar with the -prune predicate of find. Anyway, you can add/remove more
Code:
-wholename /some/path
expressions inside the escaped parentheses and separated by the logical operator -o in order to exclude or include more system directories. For an explanation of -prune, you can take a look at this post, self-citation, I know...

Hope this helps!
Hi somehow the wholename option dosent seem to work on my server.Its a solaris machine I cannot get the version number the uname -r command is giving the output as 5.I dont know how to interpret this?

Last edited by colucix; 04-23-2012 at 06:34 AM.
 
Old 04-17-2012, 04:37 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Try to see if your version of find has the -path option and in this case change -wholename with -path. Otherwise you might try to restrict the search in one directory at a time, starting from those directories where the file is supposed to be, e.g.:
Code:
find /usr -type f -exec grep -i -HI "A takle" {} \;
find /opt -type f -exec grep -i -HI "A takle" {} \;
and so on.

Last edited by colucix; 04-23-2012 at 06:35 AM.
 
Old 04-17-2012, 10:50 AM   #5
pafoo
Member
 
Registered: Jul 2011
Location: Alabama
Distribution: Red Hat/Ubuntu/Solaris
Posts: 37

Rep: Reputation: 11
If it is a automated email, the script is likely in the crontab: run

Code:
crontab -l
you can also look at the /etc/aliases
you can also look where scripts are normally run which is /usr/local/bin
You can run a recursive grep on a specific directory

Code:
grep -riI "username" /myfolder
#r is recursive
#i is uncase sensitive
#I excludes binaries
 
Old 05-03-2012, 03:02 AM   #6
Ajit Gunge
Member
 
Registered: Jan 2008
Location: Pune
Distribution: RHEL,fedora
Posts: 253
Blog Entries: 1

Original Poster
Rep: Reputation: 21
Question

Hi I have a situation here I have seen the crontab entries using the command crontab -e but I cannto see the script say "xyz" in the list of cronjobs.So definately its being called from some of the script thats in the crontab file but I am not sure exactly which script calls "xyz".Now how can I find which script exactly calls "xyz".Is there some way to do this?Please help.
 
  


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
Python - Problems when trying to run a task at log on task on windows doomloard Programming 2 06-18-2011 04:31 PM
launching a task from cli and "divorcing it from terminal task wufo Linux - General 6 02-11-2011 11:32 AM
Task bar no longer shows task Richard Rahl Linux - Newbie 3 04-12-2010 09:39 AM
i am getting the follwoing error while install the packages ravigovind29 Linux - Software 9 03-08-2007 07:56 AM
Could someone help me in the follwoing GNUPG Senario. Linux_interest Linux - Newbie 1 09-13-2004 07:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:43 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