LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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-19-2010, 04:58 AM   #1
midadala
LQ Newbie
 
Registered: Oct 2010
Posts: 3

Rep: Reputation: 0
script to execute a command based on the last modified time of a folder


Hi All,

I need a script that executes a command based on a folder's last modified time.

if "/var/data" was modified in less than an hour then "/usr/local
/etc/searchd stop" should be run


can we use "find -mmin +60 -type d" in conjunction with second command

Thanks
midadala

Last edited by midadala; 10-19-2010 at 05:29 AM.
 
Old 10-19-2010, 07:28 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,886

Rep: Reputation: 4258Reputation: 4258Reputation: 4258Reputation: 4258Reputation: 4258Reputation: 4258Reputation: 4258Reputation: 4258Reputation: 4258Reputation: 4258Reputation: 4258
Quote:
Originally Posted by midadala View Post
Hi All,
I need a script that executes a command based on a folder's last modified time. if "/var/data" was modified in less than an hour then "/usr/local
/etc/searchd stop" should be run

can we use "find -mmin +60 -type d" in conjunction with second command
Probably...why don't you just try it and see?
 
  


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
need help - script to display modified date&time of files Pawang Linux - General 3 06-01-2010 02:40 AM
Command would not execute within a script pramka SUSE / openSUSE 2 07-16-2008 10:11 AM
Run one script, but execute commands at the same time Micro420 Programming 8 07-18-2007 12:05 AM
execute php script by a time () afbase Linux - General 1 12-30-2006 03:30 PM
PHP last time modified script time way off GabeF Programming 2 11-05-2002 08:05 PM


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