Sponsored Content
Full Discussion: deleting older directories
Top Forums UNIX for Dummies Questions & Answers deleting older directories Post 302158614 by frank_rizzo on Wednesday 16th of January 2008 12:47:57 AM
Old 01-16-2008
your system probably does not support it. What OS are you using? Use the first method instead. It should work for you unless you run into weird filenames.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Deleting files older than a given date

Hi all, I want to delete all files in a directory which are older than a given date. I thought of doing it by creating a file by the required date by using touch command. And then i would use find command on that file and try to find files older than that. I searched the man and found a... (3 Replies)
Discussion started by: rajugp1
3 Replies

2. Solaris

Deleting Files Older than 24 hours

Hi, I am using Solaris Box, I need to delete file(cookies.html) from the path(/usr/temp) which are older than 24 hours(I want in hours, not in days) Can u provide the command for the above query (7 Replies)
Discussion started by: mazhar803
7 Replies

3. Shell Programming and Scripting

Script for deleting 30 days older

Hi, I need a script to delete files that are 30 days older and also the file name should contain aa or ab or ac as substring... Regards, Dolly.... (3 Replies)
Discussion started by: moon_friend
3 Replies

4. Shell Programming and Scripting

Deleting files older than 7 days

Hi Guys, I want to delete folder/files older than 7 days. Im using the command below. find /test/test1 -mtime +7 -print0 | xargs -0 rm -Rf /test/test1/* which works ok, but it deletes the test1 folder as well which i dont want. The test1 folder will have a list of sub-folders which in... (4 Replies)
Discussion started by: shezam
4 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. UNIX for Advanced & Expert Users

Deleting older files of a particular type

hi This should be easy but i'm obviously missing something obvious. :) I'm looking to delete files from yesterday and older of extension .txt and there a range of subfolders with these files in them. The command runs but doesn't delete anything. SUSE 10. find /testfolder -maxdepth 2 -type f... (6 Replies)
Discussion started by: cmap
6 Replies

7. Shell Programming and Scripting

deleting files older than 7 days

Hi Guys, I am new to unix I am looking for a script to delete files older than 7 days but i also want to exclude certain directories (like arch,log .....) and also some files with extensions ( like .ksh, .ch, ..............) Thanks (1 Reply)
Discussion started by: MAYAMAYA0451
1 Replies

8. Shell Programming and Scripting

Deleting files older than 6 hours

Hi All, I am using the below script to find all the files in a folder which are older than 6 hours and delete all those files, but some how I am not getting the required output. find $HOME/Log -type f -name "*.log" -amin +360 -exec rm *.* {} \ can any one please check and let me know... (13 Replies)
Discussion started by: subhasri_2020
13 Replies

9. Shell Programming and Scripting

Deleting Files Older than 1 hours.

How to Deleting Files Older than 1 hours. Base on SunOS. this file gen every 1 min. -rw-r--r-- 1 nobody nobody 4960 Jan 27 02:02 23_201301270201.log -rw-r--r-- 1 nobody amudu 2325 Jan 27 02:03 33_201301270202.log -rw-r--r-- 1 nobody amudu 3255 Jan 27 02:03... (2 Replies)
Discussion started by: ooilinlove
2 Replies

10. Shell Programming and Scripting

Need help deleting files one week older

Hi, I need to delete *.bad files which are 1 week old. How can I achieve that. I tried doing through below script but it deletes all the files. find ./ -mtime +7 -exec rm *.bad {} \; The below one works but i want to delete only files with .bad extension find . -mtime +7 | xargs rm (2 Replies)
Discussion started by: Gangadhar Reddy
2 Replies
File::Modified(3pm)					User Contributed Perl Documentation				       File::Modified(3pm)

NAME
File::Modified - checks intelligently if files have changed SYNOPSIS
use strict; use File::Modified; my $d = File::Modified->new(files=>['Import.cfg','Export.cfg']); while(1) { my (@changes) = $d->changed; if (@changes) { print "$_ was changed " for @changes; $d->update(); }; sleep 60; }; Second example - a script that knows when any of its modules have changed : use File::Modified; my $files = File::Modified->new(files=>[values %INC, $0]); # We want to restart when any module was changed exec $0, @ARGV if $files->changed(); DESCRIPTION
The Modified module is intended as a simple method for programs to detect whether configuration files (or modules they rely on) have changed. There are currently two methods of change detection implemented, "mtime" and "MD5". The "MD5" method will fall back to use time- stamps if the "Digest::MD5" module cannot be loaded. There is another module, File::Signature, which has many similar features, so if this module doesn't do what you need, maybe File::Signa- ture does. There also is quite some overlap between the two modules, code wise. new %ARGS Creates a new instance. The %ARGS hash has two possible keys, "Method", which denotes the method used for checking as default, and "Files", which takes an array reference to the filenames to watch. add filename, method Adds a new file to watch. "method" is the method (or rather, the subclass of "File::Modified::Signature") to use to determine whether a file has changed or not. The result is either the "File::Modified::Signature" subclass or undef if an error occurred. addfile LIST Adds a list of files to watch. The method used for watching is the default method as set in the constructor. The result is a list of "File::Modified::Signature" subclasses. update Updates all signatures to the current state. All pending changes are discarded. changed Returns a list of the filenames whose files did change since the construction or the last call to "update" (whichever last occurred). Signatures The module also creates a new namespace "File::Signature", which sometime will evolve into its own module in its own file. A file signature is most likely of little interest to you; the only time you might want to access the signature directly is to store the signature in a file for persistence and easy comparision whether an index database is current with the actual data. The interface is settled, there are two methods, "as_scalar" and "from_scalar", that you use to freeze and thaw the signatures. The imple- mentation of these methods is very frugal, there are no provisions made against filenames that contain weird characters like " " or "|" (the pipe bar), both will be likely to mess up your one-line-per-file database. An interesting method could be to URL-encode all filenames, but I will visit this topic in the next release. Also, complex (that is, non-scalar) signatures are handled rather ungraceful at the moment. Currently, I'm planning to use Text::Quote as a quoting mechanism to protect against multiline filenames. Adding new methods for signatures Adding a new signature method is as simple as creating a new subclass of "File::Signature". See "File::Signature::Checksum" for a simple example. There is one point of laziness in the implementation of "File::Signature", the "check" method can only compare strings instead of arbitrary structures (yes, there ARE things that are easier in Python than in Perl). "File::Signature::Digest" is a wrapper for Gisle Aas' Digest module and allows you to use any module below the "Digest" namespace as a signature, for example "File::Signature::MD5" and "File::Signature::SHA1". TODO * Make the simple persistence solution for the signatures better using Text::Quote. * Allow complex structures for the signatures. * Document "File::Modified::Signature" or put it down into another namespace. * Extract the "File::Modified::Signature" subclasses out into their own file. * Create an easy option to watch a whole directory tree. EXPORT None by default. COPYRIGHT AND LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Copyright (C) 2002 Max Maischein AUTHOR
Max Maischein, <corion@cpan.org> Please contact me if you find bugs or otherwise improve the module. More tests are also very welcome ! SEE ALSO
perl,Digest::MD5,Digest, File::Signature. perl v5.8.8 2008-03-21 File::Modified(3pm)
All times are GMT -4. The time now is 06:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy