LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 12-05-2006, 09:35 AM   #1
Rustylinux
Member
 
Registered: Mar 2006
Posts: 177

Rep: Reputation: 30
Need help writing script


Hello all,

My scripting and linux skills are a little rusty and I need some help writing a script. If anyone could be able to point me in the right direction or help me out with this that would be great. Here is what i'm trying to do.

I have a few folders on a windows file server that gets data pushed down to it form a temperature monitoring program. This usually updates every 2 min or so. Now I would like to write a script that would check to see if any changes are made to the folders and if no changes have been made to any of the folders for 15min to email a user. I think this might be able to be done with the "dnotify" command but I'm sure on how to program the script that it would execute or if there is a better way to do this. Here is a breif example of how the network is laided out.

Windows File Server:
\\fs4u\folder1
\\fs4u\folder2
\\fs4u\folder3
\\fs4u\folder4
\\fs4u\folder5
\\fs4u\folder6
\\fs4u\folder7
\\fs4u\folder8

These folders get updated every 2 min with temperature data.

I have a few SUSE linux system in the network any of which can be used to write a cron / script to schedule dnotify to watch these folders for any changes and email a user if non have been made. Also is it possible to even check the windows fileserver ? or would they have to be smb shares on the linux box.
 
Old 12-05-2006, 10:05 AM   #2
ZeromusM
LQ Newbie
 
Registered: May 2006
Distribution: OpenSUSE 10.0
Posts: 27

Rep: Reputation: 15
Well, if I understand it correctly, dnotify (which seems to have been replaced by inotify) alerts applications to file system changes. Since what you're looking for is an absence of changes, a better approach might be to simply `ls -clt` the folders, which will show and sort by modification dates of the files, or some variation of that command. However, if you do want to use the inotify, check out http://inotify-tools.sourceforge.net/

This can all be done through the existing windows fileserver, using samba tools to read the windows shares. See `man samba` for more info, you'll probably want to look at smbmount or smbclient depending on how you want to do things.
 
  


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
Script writing help, somebody? cwwilson721 Slackware 6 05-19-2006 09:40 PM
help writing script willinusf Programming 7 07-20-2004 11:37 AM
Help Writing a script. teeth44 Programming 2 10-14-2003 12:00 PM
Writing a Script Nyc0n Linux - General 2 05-27-2002 07:21 PM
writing a Script spanky5125 Linux - Security 5 01-08-2002 09:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

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