perl find directory only if modified in last hour


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting perl find directory only if modified in last hour
# 1  
Old 10-12-2007
perl find directory only if modified in last hour

I want a one liner perl command to find a directory only if the modified time is within the last hour

I am running this on windows - and I will define a variable for the result.

So for example I want to return value of 1 for the variable if the modified time of d:\test1 is within the last hour. If it hasnt been modified within the last hour I want to return a value of 0 for the variable so I can then print the variable name and its value to a file..

Can you help?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

To find the latest modified file in a directory

I am trying to fetch the latest modified file from a directory using the command find . -type f -exec ls -lt \{\} \+ | head | awk '{print $9}' After the O/P, I get the below mentioned error and the command doesnt terminate at all. find: ls terminated by signal 13 find: ls terminated by... (2 Replies)
Discussion started by: Sree10
2 Replies

2. Shell Programming and Scripting

Find users in 24 hour

How can I find that time when maximum number of users were login in last 24 hours. We have 500 users in that server. ---------- Post updated at 02:13 PM ---------- Previous update was at 01:17 PM ---------- on particular date 26-march-2013. Just for example we want to trace in which timings... (5 Replies)
Discussion started by: learnbash
5 Replies

3. Shell Programming and Scripting

Script to Change Permission on a directory after every hour

I want to change the permission of a dir to 777 after every hour in a background process.I do not have the access to the crontab , is there another way of doing it a scrit of some thing like that . Any help will be great. (1 Reply)
Discussion started by: neeraj617
1 Replies

4. Shell Programming and Scripting

last modified directory

hi everyone suppose i have many directory under one directory. now i want to find out the last modified directory so i executed the command ls -ltr but it gives me the directory structure too and i don't want this so i removed 'r' also but it too gives me directory... (2 Replies)
Discussion started by: aishsimplesweet
2 Replies

5. Shell Programming and Scripting

Copy last modified directory from path using Perl

Hi I need to copy last modified directory from path /users/bin to be copied to /tmp in a perl script ...somehow my script is not allowing me to do cd /users/bin. i have tried $dir = `find /users/bin -maxdepth 1 -type d -mtime 0 ` cp -R $dir /tmp/new but it says missing destination... (1 Reply)
Discussion started by: shaveta
1 Replies

6. Shell Programming and Scripting

Copy Last modified directory to another directory

Hi, I have to copy last modified Directory to another directory.How can i Do using pipe or redirect cp -R 'ls -lrt|tail -1' test is not working. please help. (3 Replies)
Discussion started by: shaveta
3 Replies

7. Shell Programming and Scripting

Find files modified in last hour sunOS 5.10

trying to find a way to locate files modified in the last hour in a shell script, unfortunately the command 'find . -mmin -60' is not supported on SunOS 5.10 (works on OpenSolaris 5.11 :mad:) Does anyone know a method of doing this in shell script on 5.10? cheers (19 Replies)
Discussion started by: rich@ardz
19 Replies

8. Shell Programming and Scripting

Find the directory modified/created before 4 days

Hi, I have an application which creates some directories while running. I want to delete these directories which are 4 days older. i tried find . type d -mtime +1 -print And it is working fine.. but find . type d -mtime +4 -print is not giving any results which are 4 days... (6 Replies)
Discussion started by: Tuxidow
6 Replies

9. UNIX for Dummies Questions & Answers

how to use sed or perl command to find and replace a directory in a file

how to use sed command to find and replace a directory i have a file.. which contains lot of paths ... for eg.. file contains.. /usr/kk/rr/12345/1 /usr/kk/rr/12345/2 /usr/kk/rr/12345/3 /usr/kk/rr/12345/4 /usr/kk/rr/12345/5 /usr/kk/rr/12345/6 /usr/kk/rr/12345/7... (1 Reply)
Discussion started by: wip_vasikaran
1 Replies

10. Shell Programming and Scripting

If any file resides for more than an hour in this directory then to raise an alert

Hi If there is a file upload done from a remote server and if the file remains without being extracted for more than an hour, I need to identify the files and create an alert message to the users in the other end. please help me writing a shell script for it. Regards Yazhini (2 Replies)
Discussion started by: yazhini.t
2 Replies
Login or Register to Ask a Question
PEGASUS-CONFIG(1)														 PEGASUS-CONFIG(1)

NAME
pegasus-config - The authority for where parts of the Pegasus system exists on the filesystem. pegasus-config can be used to find libraries such as the DAX generators. SYNOPSIS
pegasus-config [-h] [--help] [-V] [--version] [--noeoln] [--perl-dump] [--perl-hash] [--python-dump] [--sh-dump] [--bin] [--conf] [--java] [--perl] [--python] [--python-externals] [--schema] [--classpath] [--local-site] [--full-local] DESCRIPTION
pegasus-config is used to find locations of Pegasus system components. The tool is used internally in Pegasus and by users who need to find paths for DAX generator libraries and schemas. OPTIONS
-h, --help Prints help and exits. -V, --version Prints Pegasus version information --perl-dump Dumps all settings in perl format as separate variables. --perl-hash Dumps all settings in perl format as single perl hash. --python-dump Dumps all settings in python format. --sh-dump Dumps all settings in shell format. --bin Print the directory containing Pegasus binaries. --conf Print the directory containing configuration files. --java Print the directory containing the jars. --perl Print the directory to include into your PERL5LIB. --python Print the directory to include into your PYTHONLIB. --python-externals Print the directory to the external Python libraries. --schema Print the directory containing schemas. --classpath Builds a classpath containing the Pegasus jars. --noeoln Do not produce a end-of-line after output. This is useful when being called from non-shell backticks in scripts. However, order is important for this option: If you intend to use it, specify it first. --local-site [d] Create a site catalog entry for site "local". This is only an XML snippet without root element nor XML headers. The optional argument "d" points to the mount point to use. If not specified, defaults to the user's $HOME directory. --full-local [d] Create a complete site catalog with only site "local". The an XML snippet without root element nor XML headers. The optional argument "d" points to the mount point to use. If not specified, defaults to the user's $HOME directory. EXAMPLE
To set the PYTHONPATH variable in your shell for using the Python DAX API: export PYTHONPATH=`pegasus-config --python` To set the same path inside Python: config = subprocess.Popen("pegasus-config --python-dump", stdout=subprocess.PIPE, shell=True).communicate()[0] exec config To set the PERL5LIB variable in your shell for using the Perl DAX API: export PERL5LIB=`pegasus-config --perl` To set the same path inside Perl: eval `pegasus-config --perl-dump`; die("Unable to eval pegasus-config output: $@") if $@; will set variables a number of lexically local-scoped my variables with prefix "pegasus_" and expand Perl's search path for this script. Alternatively, you can fail early and collect all Pegasus-related variables into a single global %pegasus variable for convenience: BEGIN { eval `pegasus-config --perl-hash`; die("Unable to eval pegasus-config output: $@") if $@; } AUTHOR
Pegasus Team http://pegasus.isi.edu 05/24/2012 PEGASUS-CONFIG(1)