LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-29-2012, 12:49 PM   #1
rajsrmc
LQ Newbie
 
Registered: May 2008
Posts: 4
Blog Entries: 1

Rep: Reputation: 0
Requesting Shell script


Hi All,

I request a shell script for the below task

1. List all Zip files in a directory i.e. "/home/Hunter/" and check for files updated in last 10 minutes
2. Grep Pattern i.e. "error" from all the *.zip files updated in last 10 minutes.
3. Send grepped pattern to newfile.log file.
4. Above functinality in a script needs to be scheduled in a cronjob.

Help will be really grateful.

Thanks
Rajendran
 
Old 11-29-2012, 04:14 PM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by rajsrmc View Post
Hi All,
I request a shell script for the below task

1. List all Zip files in a directory i.e. "/home/Hunter/" and check for files updated in last 10 minutes
2. Grep Pattern i.e. "error" from all the *.zip files updated in last 10 minutes.
3. Send grepped pattern to newfile.log file.
4. Above functinality in a script needs to be scheduled in a cronjob.
If you want someone to write your scripts/programs for you, then you need to PAY THEM. List this in the LQ Job Marketplace, along with how much you'd pay, and someone may do it.

Just posting something like this is very, VERY rude...why should others do your work for you?? This is a place to come for HELP...that is, you post what YOU have written/tried, and explain where you're stuck. Someone will be more than happy to assist you. But just asking and expecting others to spoon-feed you things is wrong.
 
2 members found this post helpful.
Old 11-29-2012, 07:51 PM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Now that you've been appropriately and deservedly chastised, here's what you do. Read enough of the links provided by Habitual, until you've got enough to get a start on your project. When you've got something that looks like a reasonable start, but you just can't get past one or two hurdles, post (in [CODE] [/CODE] tags please) your code here, along with a written description of the problem spot. I'll give you an advance lesson about that last part: "doesn't work" is not a description of the fault. A description should include what it is expected to do, and how it differs from the expected. Looking forward to seeing how you progress.
--- rod.
 
1 members found this post helpful.
Old 11-29-2012, 08:14 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I don't want to discourage anyone from helping, but the sad truth is that we are not likely to hear from the OP anytime soon. To be sure, it is not the standard, one-post-only, homework troll. But I think it will likely become one of the all too common abandoned threads. My guess is that maybe 2/3 of the threads where I have helped (or observed) lately have been abandoned.

I'm ruminating about a help site that charges an enrollment fee. Said fee would be refunded after the management team is satisfied that the member is "real"
 
Old 12-05-2012, 01:32 AM   #6
asimba
Member
 
Registered: Mar 2005
Location: 127.0.0.0
Distribution: Red Hat / Fedora
Posts: 355

Rep: Reputation: 42
I guess I would have done it this way

Code:
my_files=($( find ~ -mmin -10))   #should get you files in specific location that have changed in past 10 minutes


for i in my_files; do

zcat my_file | grep -i error >> myzip.err

done
of course this is simplified version (I have intentionally left some work) - but hint is good enough to help you all the way.
 
  


Reply



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
[SOLVED] Requesting help to modify simple XML with SED script -=ALS=- Linux - Newbie 3 03-01-2012 09:20 PM
[SOLVED] Requesting Assistance with Perl script to compare two files pspreben Linux - Software 11 09-09-2011 12:41 AM
Executing a Shell script with 654 permissions inside another shell script. changusee2k Linux - Newbie 2 06-07-2011 07:58 PM
Requesting shell script that only outputs directories that contain subdirectories cyrilic Programming 4 01-08-2010 09:26 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:52 PM.

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
Open Source Consulting | Domain Registration