Sponsored Content
Top Forums Shell Programming and Scripting Find out whether directory has been updated with files in the last 5 minutes or not Post 302660221 by methyl on Friday 22nd of June 2012 08:35:28 AM
Old 06-22-2012
Your O/S does support "find -mtime" but not "find -mmtime".

Basic technique is to set up a cron to run every 5 minutes during the period of the day you want to run this monitor (but starting 5 minutes before the first time you want to monitor).
Script uses "find -newer" against a marker file and changes the timestamp of the marker file after each check.

Code:
#!/bin/ksh
if [ ! -f /var/tmp/junk/marker ]
then
        touch /var/tmp/junk/marker
        exit
fi

found=`find /path/directory -type f -newer /var/tmp/junk/marker -print | wc -l`
if [ ${found} -gt 0 ]
then
        echo "Files found"
else
        echo "No files found"
fi
touch /var/tmp/junk/marker

We'll leave you to decide what "send out an alert" means.

Last edited by methyl; 06-22-2012 at 09:37 AM.. Reason: Add Shebang line or it won't work in Solaris cron
This User Gave Thanks to methyl For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

find files onder than 15 minutes

Hi Friends, i have to write a script to raise a flag if there are any files that are older than 15 minutes in the directory.The directory is supplied as the parameter to the script. please help with a sample script. Thanks in advance veera (11 Replies)
Discussion started by: sveera
11 Replies

2. Shell Programming and Scripting

only find files older than x minutes old

I am looking for a way to show files that have been created within a certain period (say anything older than 10 minutes or so). Is there a command/series of commands I can do this with? As an example, I have the following in a directory: -rw-r--r-- 1 owner group 70175 May 16 09:10... (1 Reply)
Discussion started by: dsimpg1
1 Replies

3. Shell Programming and Scripting

Find files on minutes basis

Hello, I was trying to find files which are created in last five minutes . I tried to use command find with ntime and mtime but was not successfull then i read from this forum that we can not have a find option on minutes or seconds or hours...... Can somebody Pls expalin how can i search... (3 Replies)
Discussion started by: er_aparna
3 Replies

4. Shell Programming and Scripting

delete files older than 5 minutes in directory (recursively)

sorry guys can some please give me a hint how to achieve this in a slick oneliner? delete files older than 5 minutes in specified directory (recursively) peace (3 Replies)
Discussion started by: scarfake
3 Replies

5. Shell Programming and Scripting

Find recently updated files in home directory

Is there a shell command that will allow me to list index files in the /home directory for all users on a server that have been updated within the past 24 hours? (e.g. index.htm .html .php in/home/user1/public_html /home/user2/public_html /home/user3/public_html etc ) (2 Replies)
Discussion started by: Kain
2 Replies

6. Shell Programming and Scripting

Find files which are <n> minutes old

Hi, i want to find certain files which are more than <n> minutes old,i have the command to find the files say <n> days old(as below) but not in terms of minutes. find . -name "14*.000" -type f -mtime +1 Is there any way to find this? Regards, Cherry (3 Replies)
Discussion started by: cherryven75
3 Replies

7. Shell Programming and Scripting

find files created within 30 minutes

find . -name *.txt -mmin -30 This is working in Redhat but not in Solaris.. What is the equivalent option in Solaris? (1 Reply)
Discussion started by: tene
1 Replies

8. Shell Programming and Scripting

Help needed to print the not updated files in the Directory

Hi All, I have written one program to print the files which are not updated in the specified directory in .Dat file. If I am executing the same command in the command prompt its working fine but if I am executing in shell script it's not working fine. Please correct if any thing wrong in the... (3 Replies)
Discussion started by: bbc17484
3 Replies

9. UNIX for Beginners Questions & Answers

Find file that are accessed less than 10 minutes in a directory

Hi All,, I need to find the latest files that are accessed less than 10mins in a particular directory & send those files in an attachment. I could use the below simple one. But if the directory was not updated any recently i could mail the old file again, i need to eliminate that.. What shld... (8 Replies)
Discussion started by: Jeevitha
8 Replies

10. UNIX for Beginners Questions & Answers

Find if create time of last created file in a directory is older than 5 minutes

A process xyz is running and creating file1, file2, file3, .... filen. how do i know if the process has stopped and createtime of the last file (filen) is older than 5 minutes? OS is AIX (3 Replies)
Discussion started by: malaika
3 Replies
Bio::PopGen::Marker(3pm)				User Contributed Perl Documentation				  Bio::PopGen::Marker(3pm)

NAME
Bio::PopGen::Marker - A genetic marker which one uses to generate genotypes SYNOPSIS
my $name = $marker->name(); # marker name my $description = $marker->description(); # description my $type = $marker->type(); # coded type of the marker my $unique_id = $marker->unique_id; # optional unique ID my @alleles = $marker->get_Alleles(); # the known alleles my %allele_freqs = $marker->get_Allele_Frequencies(); # keys are marker names # vals are frequencies # may change to handle multiple populations DESCRIPTION
This object will not contain genotype information pertaining to an individual, but rather population level statistics and descriptive information about a marker. FEEDBACK
Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists Support Please direct usage questions or support issues to the mailing list: bioperl-l@bioperl.org rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR - Jason Stajich Email jason-at-bioperl.org CONTRIBUTORS
Matthew Hahn, matthew.hahn-at-duke.edu APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ new Title : new Usage : my $obj = Bio::PopGen::Marker->new(); Function: Builds a new Bio::PopGen::Marker object Returns : an instance of Bio::PopGen::Marker Args : -name => [string] marker name -description => [string] marker description -type => [string] marker type -unique_id => [string/int] unique id -allele_freq => [hash ref] allele frequencies name Title : name Usage : my $name = $marker->name(); Function: Get the name of the marker Returns : string representing the name of the marker Args : [optional] name description Title : description Usage : my $desc = $marker->description Function: Get the marker description free text Returns : string Args : [optional] string type Title : type Usage : my $type = $marker->type; Function: Get coded string for marker type Returns : string Args : [optional] string unique_id Title : unique_id Usage : my $id = $marker->unique_id; Function: Get the unique marker ID Returns : unique ID string Args : [optional ] string annotation Title : annotation Usage : my $annotation_collection = $marker->annotation; Function: Get/set a Bio::AnnotationCollectionI for this marker Returns : Bio::AnnotationCollectionI object Args : [optional set] Bio::AnnotationCollectionI object get_Alleles Title : get_Alleles Usage : my @alleles = $marker->get_Alleles(); Function: Get the available marker alleles Returns : Array of strings Args : none get_Allele_Frequencies Title : get_Allele_Frequencies Usage : my %allele_freqs = $marker->get_Allele_Frequencies; Function: Get the alleles and their frequency (set relative to a given population - you may want to create different markers with the same name for different populations with this current implementation Returns : Associative array where keys are the names of the alleles Args : none add_Allele_Frequency Title : add_Allele_Frequency Usage : $marker->add_Allele_Frequency($allele,$freq) Function: Adds an allele frequency Returns : None Args : $allele - allele name $freq - frequency value reset_alleles Title : reset_alleles Usage : $marker->reset_alleles(); Function: Reset the alleles for a marker Returns : None Args : None perl v5.14.2 2012-03-02 Bio::PopGen::Marker(3pm)
All times are GMT -4. The time now is 12:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy