LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-23-2011, 06:06 AM   #1
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
how can i get alert when a file are folder get updated in segate network drive


Hi

i have a segate network hard drive accessed by 1500 user and i have admin user login in network drive get shared for all user in network for accessing softwares and important creditential . I want to automatically run a script whenever new files are copied into a particular directory. In other words, is there a way in Linux to "watch" a directory for changes and then run something in response to the change?

Regards
arun

Last edited by jsaravana87; 09-23-2011 at 09:17 AM.
 
Old 09-23-2011, 08:07 AM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
If I understand correctly, you want the update of a file in a known directory to trigger an email alert to known users.
You can write a script using 'inotifywait' that will monitor the directory and send the email alert.
This link may be of use. http://www.infoq.com/articles/inotif...ent-monitoring
 
1 members found this post helpful.
Old 09-23-2011, 08:24 AM   #3
ramecare
Member
 
Registered: Feb 2011
Posts: 179

Rep: Reputation: 0
hi

mnt the netdrive and write a shell scripts to get ur task


Thanks

Last edited by ramecare; 09-23-2011 at 08:35 AM.
 
0 members found this post helpful.
Old 09-23-2011, 08:38 AM   #4
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558

Original Poster
Blog Entries: 5

Rep: Reputation: Disabled
i had mounted my network drive in /net folder
mkdir /netdrive
mount -t cifs //19.12.25.32/servers/$(hostname) /netdrive -o username=tech,password=scripts

how can i read name of a folder and file in /net directory


Regards
arun

Last edited by jsaravana87; 09-23-2011 at 08:39 AM.
 
Old 09-23-2011, 09:37 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by arun5002 View Post
i had mounted my network drive in /net folder
mkdir /netdrive
mount -t cifs //19.12.25.32/servers/$(hostname) /netdrive -o username=tech,password=scripts

how can i read name of a folder and file in /net directory
Did you not read post #2 from allend?? The solution is there...use inotifywait, or write your own shell script to periodically look at the contents of a directory, and do whatever you wish.

Doesn't matter if it's a network drive, local storage, or USB attached...it's all just a mount point, and your scripts treat it as such.
 
  


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
1TB Segate Usb External Hard Drive jaypatience Linux - Hardware 3 06-20-2011 05:33 AM
In a folder hierarchy, find the last updated file threezerous Linux - Newbie 2 06-03-2011 01:07 AM
Mounting network drive under a user's home folder, possible? XGhozt Red Hat 6 04-25-2011 10:29 PM
Best Network Drive/Folder Interface vcatalano Linux - Server 3 03-24-2010 12:33 PM
I get an alert something not updated or/and upgraded success, is any repair procedure lse123 Ubuntu 3 03-17-2010 11:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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