- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- File Find
Operating System - HP-UX
1752575
Members
4162
Online
108788
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2003 07:41 AM
тАО10-24-2003 07:41 AM
File Find
I hope I can outline this clearly the first time. I have been asked to create a script to do the following:
Search a series of Directories that have been created withing 15 minutes of the current system time for a dynamic file name that ends in (dot)out .out.
If a file with that extension is found, search the file for the word "error".
If error is found, send an email to a data center operator.
If the word is NOT found, do nothing.
I believe I can handle items 3 and 4, but I am looking for help and suggestions in accomplishing item 1.
Thanks in Advance.
Search a series of Directories that have been created withing 15 minutes of the current system time for a dynamic file name that ends in (dot)out .out.
If a file with that extension is found, search the file for the word "error".
If error is found, send an email to a data center operator.
If the word is NOT found, do nothing.
I believe I can handle items 3 and 4, but I am looking for help and suggestions in accomplishing item 1.
Thanks in Advance.
Life is ...
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2003 07:58 AM
тАО10-24-2003 07:58 AM
Re: File Find
The find command has the ability to locate files newer than the timestamp on a reference file. Simply use touch to create a dummy (zero-length) file that is 15 minutes old, then use i
find -newer -name '*out.out'
Note that find (unlike most commands) knows about pattern matching so escape the shell's expansion using single quotes.
Bill Hassell, sysadmin
find -newer
Note that find (unlike most commands) knows about pattern matching so escape the shell's expansion using single quotes.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2003 08:52 AM
тАО10-24-2003 08:52 AM
Re: File Find
But that does not answer the timing issues. I do not want to research the same dir. every 15 minutes? Any suggestions on doing this?
Life is ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-24-2003 10:41 AM
тАО10-24-2003 10:41 AM
Re: File Find
"perl -le 'print scalar localtime time - 900'"
will give you the current time - 15 minutes.
...combine that with a recursive check of the time stamps of your directories, and you should be able to find any files that have been created within 15 minutes of your running the script.
will give you the current time - 15 minutes.
...combine that with a recursive check of the time stamps of your directories, and you should be able to find any files that have been created within 15 minutes of your running the script.
Remember, wherever you go, there you are...
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP