473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Urgent:script to send a mail when the file is updated

I need a unix shell script where if u issue a command then it should ask for one dir name and file name and whn input is given it should search for that file with the current date and if tht file is updated after 3:30 a.m then a mail should be sent to you saying "file is updated" and if it is not updated you have to send a mail saying that "file not updated".
Sep 26 '07 #1
1 1803
tdob
4
Hi,

here's an example which is working on linux, it can be run from cron . Options for find can be different on bsd or another unix.

Expand|Select|Wrap|Line Numbers
  1. dir="/tmp"
  2. filename="aaa"
  3. last_modif_minutes=30
  4.  
  5. modified=`find $dir -type f -name $filename -mmin $last_modif_minutes`
  6. echo $modified
  7.  
  8. if [ -z $modified ]; then
  9.     echo "not modified" | /usr/sbin/sendmail $mail_addr
  10. else
  11.     echo "modified" | /usr/sbin/sendmail $mail_addr
  12. fi
  13.  
  14.  
Regards,
tdob
Oct 1 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: jedi | last post by:
i preparing report with html and sendin user as woerd documan, i need to learn how i can insert footer or header and new page ( to seperate cover page and others) for desining the page i m...
1
by: sathya | last post by:
hi, i have problem in httphandler, my problem is that when i am trying to use server.execute(/default.aspx) i am getting error.... Here i am trying to redirect from home.aspx to...
7
by: Gordon Smith | last post by:
I have four (4) ASP.NET Web applications/Web sites on a IIS/6 - Windows Server 2003 production server. 3 of them work fine. I just installed the 4th one and it's Application_Start event is not...
1
by: sathya | last post by:
hi, i have problem in httphandler, my problem is that when i am trying to use server.execute(/default.aspx) i am getting error.... Here i am trying to redirect from home.aspx to...
13
by: Niyazi | last post by:
Hi I have a report that I have to run it monthly in my machine. My code in VB.NET and I access AS400 to get data, anaysie it and send into pre formated Excel sheet. The data consist of 9000...
3
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from...
1
by: sohail28 | last post by:
Respected Sir /Madam, I create one web page which includes online reservation using phpscript. Now this page is working fine, but it executes on the same page. i want here, when i click...
3
by: optionsindia | last post by:
hi partners, we are having a urgent requirement for java architect with our clients located at chennai,hyderabad and bangalore if u r intrested send u r updated resume mail to:...
4
borisding
by: borisding | last post by:
Hi there, Well, I really need help from someone here, and hope that someone will answer my question and solve my problem. I know it's very common question and being asked by many developers: ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.