Sponsored Content
Top Forums Shell Programming and Scripting Find directories that are not used for 500 days Post 302588404 by sajuatl on Monday 9th of January 2012 01:02:21 AM
Old 01-09-2012
Find directories that are not used for 500 days

How to list the directories that are not acessed for more than 500 days?

i used find in the following way
Code:
find . -type d -atime +500 -exec du -sh {} \;

but it is listing all the sub direcories of the parent directories which satisfy above condiion.I would like to get just name of the parent directories(not subdirectories).their last acess time with size.


Thanks.


Moderator's Comments:
Mod Comment How to use code tags

Last edited by Franklin52; 01-09-2012 at 03:27 AM.. Reason: Please use code tags for code and data samples, thank you
 

10 More Discussions You Might Find Interesting

1. HP-UX

Command for delete the directories which are older than 7 days

Hi, My requirement is need to delete the directories (Including files also) which are older than 7 days. So I used below command in one script (script takes 2 input parameters) #$1 - Path of the directory from where we have to delete the directories.# #$2 - Number of days older... (1 Reply)
Discussion started by: sridhar sivakot
1 Replies

2. Shell Programming and Scripting

Delete files from sub-directories over 7 days

Can any one please help me in deleting all the Files over 7 days from sub-directories A, B, C... Top-Directory Sub-Directory-A File-1 File-2 ..... File-n Sub-Directory-B File-1 File-2 ..... File-n Sub-Directory-C File-1 ... (1 Reply)
Discussion started by: sureshcisco
1 Replies

3. Red Hat

Find files older than 30 days in directories and delete them

Hi, I have dummies questions: My script here can find the files in any directories older than 30 days then it will delete the files but not the directories. I would like to also be able to delete the directories that hold old files more than 30 days not just the files itself. find . -type f... (2 Replies)
Discussion started by: lamoul
2 Replies

4. Shell Programming and Scripting

Using cron to delete directories 90 days old

We use Solaris 10 x86 and I want to use a cron job to remove directories +90 old. Currently I have the command below but it only cleans the files and keeps the directory. What am I doing wrong? /opt/tesk/batch/kit/archive/* -mtime +90 -exec rm -r {} \: Thank you (3 Replies)
Discussion started by: oh-daa
3 Replies

5. Shell Programming and Scripting

Script for parsing directories one level and finding directories older than n days

Hello all, Here's the deal...I have one directory with many subdirs and files. What I want to find out is who is keeping old files and directories...say files and dirs that they didn't use since a number of n days, only one level under the initial dir. Output to a file. A script for... (5 Replies)
Discussion started by: ejianu
5 Replies

6. Shell Programming and Scripting

Finding directories older than 5 days

Hello, Motive: Search all directories which are older than 5 days. Example: consider following directory structure: abc/dir1 abc/dir1/dir abc/dir2 abc/dir3 abc/dir3/temp Suppose dir1 and dir3 are 5 days older. Then I am looking for a command which lists abc/dir1 and abic/dir3 only so that... (4 Replies)
Discussion started by: mytempid07
4 Replies

7. Shell Programming and Scripting

Find directories only and delete them created 3 days before

Hello I have some directories and files created under /export/local/user I would like to delete directories only under /export/local/user, created before 3 days Can someone help me with command to do this task? Thanks (4 Replies)
Discussion started by: needyourhelp10
4 Replies

8. Shell Programming and Scripting

Fill the values between -500 to 500 -awk

input -200 2.4 0 2.6 30 2.8 output -500 0 -499 0 -488 0 .......... .......... .... -200 2.4 .... ... 0 2.6 (6 Replies)
Discussion started by: quincyjones
6 Replies

9. HP-UX

Find file more than 500 MB

Hi, I used to use the below command on Solaris find /var/tmp -size +500000 -exec ls -e {} \; but this command does not seem to work on HP-UX. Can you help me list all files under /var/tmp and its sub-directories which are more than 500MB in size ? (7 Replies)
Discussion started by: mohtashims
7 Replies

10. UNIX for Dummies Questions & Answers

How to compress the directories which is older than 7 days?

Hi all, how to compress the directories which is older 7 days. If any one knows please help me this is urgent. Thanks in advance (3 Replies)
Discussion started by: rameshpagadala
3 Replies
SVN_LS(3)								 1								 SVN_LS(3)

svn_ls - Returns list of directory contents in repository URL, optionally at revision number

SYNOPSIS
array svn_ls (string $repos_url, [int $revision_no = SVN_REVISION_HEAD], [bool $recurse = false], [bool $peg = false]) DESCRIPTION
This function queries the repository URL and returns a list of files and directories, optionally from a specific revision. This is equiva- lent to svn list $repos_url[@$revision_no] Note This function does not work with working copies. $repos_url must be a repository URL. PARAMETERS
o $url - URL of the repository, eg. http://www.example.com/svnroot. To access a local Subversion repository via filesystem, use the file URI scheme, eg. file:///home/user/svn-repos o $revision - Integer revision number to retrieve listing of. When omitted, the HEAD revision is used. o $recurse - Enables recursion. RETURN VALUES
On success, this function returns an array file listing in the format of: [0] => Array ( [created_rev] => integer revision number of last edit [last_author] => string author name of last edit [size] => integer byte file size of file [time] => string date of last edit in form 'M d H:i' or 'M d Y', depending on how old the file is [time_t] => integer unix timestamp of last edit [name] => name of file/directory [type] => type, can be 'file' or 'dir' ) [1] => ... NOTES
Warning This function is EXPERIMENTAL. The behaviour of this function, its name, and surrounding documentation may change without notice in a future release of PHP. This function should be used at your own risk. EXAMPLES
Example #1 svn_ls(3) example <?php print_r( svn_ls('http://www.example.com/svnroot/') ); ?> The above example will output something similar to: Array ( [0] => Array ( [created_rev] => 20 [last_author] => Joe [size] => 0 [time] => Apr 02 09:28 [time_t] => 1175520529 [name] => tags [type] => dir ) [1] => Array ( [created_rev] => 23 [last_author] => Bob [size] => 0 [time] => Apr 02 15:15 [time_t] => 1175541322 [name] => trunk [type] => dir ) ) SEE ALSO
SVN documentation on svn list. PHP Documentation Group SVN_LS(3)
All times are GMT -4. The time now is 02:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy