- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: find content by second
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
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
Community
Resources
Forums
Blogs
- 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
05-02-2008 05:17 AM
05-02-2008 05:17 AM
find content by second
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2008 05:37 AM
05-02-2008 05:37 AM
Re: find content by second
Use Perl;
This script will find files in the current directory that have been modified within the number of seconds passed as an argument:
# perl -MFile::Find -le '$secs=shift||60;find(sub{print $File::Find::name if -f $_ && -M _ <= $secs/86400},".")'
By default, 60-seconds is assumed. To look for files in '/tmp' modified in the last hour, you would do:
# cd /tmp;
# perl -M...)' 3600
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2008 05:47 AM
05-02-2008 05:47 AM
Re: find content by second
Any way..
Here is a different twist.
Have your script create a file.
Then use find with the -newer option to find all files newer than the file you just created.
Go to sleep for 1 second
touch your file again
then find again.
e.g.
while true
do
> control.file
find ./ -newer control.file
sleep 1
done
I would expect this script to chow up CPU and disk resources depending on the size of the directory your are searching, and again, if it takes more than a second to do the search then output will be irrelevant. Maybe sleep 10 is better ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2008 02:00 AM
05-05-2008 02:00 AM
Re: find content by second
# perl -MFile::Find -le '$secs=shift||60;find(sub{print $File::Find::name if -f $_ && -M _ <= $secs/86400},".")'
ps.
2 Hr = 2880 second
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2008 04:38 AM
05-05-2008 04:38 AM
Re: find content by second
There is no mmin option with the find in HP-UX.
You mean you will run the cron in every 2 hrs and will send the mail to the admin. So, how come the 1 second requirement. Can you please elaborate your requirement more in detail.
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2008 05:41 AM
05-05-2008 05:41 AM
Re: find content by second
Transmit the difference in the lists and update the transmitted list.
Initialization of the "transmitted" list, and when this should be done are left as an excercise....