LinuxQuestions.org
Visit Jeremy's Blog.
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 09-23-2009, 12:50 AM   #1
chand.admn
LQ Newbie
 
Registered: Sep 2009
Posts: 3

Rep: Reputation: 0
Shell scirpt for log file mgmt


Hi ,

I am new bie to shell scripting.

I need a shell script for LINUX and SOLARIS that will check for last modification date of all the files in a particluar folder and will move the files to /tmp which have been created/modified 2 months before.


Please help me in this regard.

Babu.
 
Old 09-23-2009, 01:23 AM   #2
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Look into logrotate - or apparently logadm on Solaris if that's better for you. Otherwise, just read the 'find' and 'mv' manuals and stick the resulting stuff in cron. It's easy enough to do a barebones version and only you can know how flexible/detailed you want it.

Oh, and welcome to LQ!
 
Old 09-23-2009, 05:02 AM   #3
chand.admn
LQ Newbie
 
Registered: Sep 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Hello,

Thanks for the reply, I am aware of mv , ls such type of commands,

Could you please give the script how would you be able to perform tha acitivity with mv and ls alone.
 
Old 09-23-2009, 05:52 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Let's see your attempts first. Generally LQ gives a "helping hand", not a "hand out".
 
Old 09-23-2009, 06:35 AM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Some useful beginners tutorials:

LinuxCommand.org
Bash Guide for Beginners
Linux Shell Scripting Tutorial

And a simple search through the archives or google should turn up info on how to use find to filter files by modification date.
 
Old 09-23-2009, 11:37 PM   #6
chand.admn
LQ Newbie
 
Registered: Sep 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks
 
  


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
how to use xls file in perl scirpt bharatbsharma Programming 2 06-10-2008 02:57 PM
Log all of a shell script's I/O to the console and a file trevelluk Programming 8 04-18-2005 01:40 PM
File Mgmt. App jhansman Linux - Software 0 09-08-2003 12:49 PM
bash shell scirpt help Rex_chaos Linux - General 6 07-29-2003 11:17 AM
Speedtouch mgmt.o file : where to get it! psychoholic Linux - Networking 3 03-20-2003 01:37 PM

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

All times are GMT -5. The time now is 05:52 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
Open Source Consulting | Domain Registration