Sponsored Content
Top Forums Shell Programming and Scripting Deleting entries older than 7 days from a file Post 302728007 by jim mcnamara on Wednesday 7th of November 2012 08:13:20 AM
Old 11-07-2012
Are those actual filenames? Otherwise I cannot see anything date-related with those lines of data.
Code:
# assume 2012 10 27  is seven days ago so
touch -t 201210270000  dummy
while read fname
do
  [ $fname -nt dummy ] && echo $fname
done < inputfile > newoutputfile

And please stop bumping posts.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Delete user file(s) older then 'X' days ??

I want to delete any file in unix file system which is older then a week. Those files should not be unix system file..means it should be user created file. Any clue to this ?? ASAP. Thanks. (2 Replies)
Discussion started by: varungupta
2 Replies

2. Shell Programming and Scripting

delete file older than N days

Hi, All, I'd like to delete files older than 1 day. I thought the following command find /your_directory -mtime +1-exec rm -f {} \; will do the work, but not so, it seems like it won't delete files unless it is 2 days old or older. the files between 1 day and 2 days old does not... (7 Replies)
Discussion started by: ericaworld
7 Replies

3. Shell Programming and Scripting

Deleting / finding files older than X days missess a day

Hi When trying to find and delete files which are, say, 1 day, the find command misses a day. Please refer the following example. xxxd$ find . -type f -ctime +1 -exec ls -ltr {} \; total 64 -rw-rw-r-- 1 oracle xxxd 81 Apr 30 11:25 ./ful_cfg_tmp_20080429_7.dat -rw-rw-r-- 1... (4 Replies)
Discussion started by: guruparan18
4 Replies

4. 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

5. 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

6. UNIX for Dummies Questions & Answers

Deleting specfic files older than N days

Hello, I am trying to delete specific files older than 7 days that start with FSTRnnnn (nnnn=sequnce number) from /home/users/userdir I.E cd home/users/userdir ll FSTR0001 Jul 8 14:20 FSTR0002 Jul 6 12:01 FSTR0003 May 25 09:45 FSTR0004 April 2 17:20 MSTR0034 Jul 6 12:45... (3 Replies)
Discussion started by: eurouno
3 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. AIX

Deleting files older than 14 days automatically

Hi In my aix server under the location "/usr/sap/SAPXI/extract", I have a lot of log files. I need a script which is to be added in crontab so that the files and directories older than 14 days should get deleted automatically from the location "/usr/sap/SAPXI/extract". Please advise me.... (3 Replies)
Discussion started by: samsungsamsung
3 Replies

9. UNIX for Dummies Questions & Answers

Delete file older than three days

I am using SFTP to transmit files from the Mainframe to an UNIX server. I am looking for some kind of script that runs with SFTP to delete tranmitted files older than 3 days. Can this be done in a SFTP transmission batch job? (5 Replies)
Discussion started by: Steve Carlson
5 Replies

10. UNIX for Dummies Questions & Answers

Script for Deleting files older than 14 days automatically

we need to have periodic clean up implemented in our sap directory \\sapds\PR1\int\scm\snp\outbound\snapshot. which needs unix script for Deleting files older than 14 days automatically in sap system unix os. (1 Reply)
Discussion started by: kvkreddy_b2w
1 Replies
clm imac(1)							  USER COMMANDS 						       clm imac(1)

  NAME
      clm imac - Interpret Matrices (c.q. MCL iterands output by mcl) As Clusterings.

      clmimac  is not in actual fact a program. This manual page documents the behaviour and options of the clm program when invoked in mode imac.
      The options -h, --apropos, --version, -set, --nop are accessible in all clm modes. They are described in the clm manual page.

  SYNOPSIS
      clm imac -imx <fname> [options]

      clm imac -imx fname (input file) [-o fname (name/stem for output)] [-dag fname (output  DAG)]  [-overlap	str  (overlap  mode)]  [-sort  str
      (size|revsize|lex|none)]	[-strict  num (in 0..1)] [-h (print synopsis, exit)] [--apropos (print synopsis, exit)] [--version (print version,
      exit)]

  DESCRIPTION
      Use clm imac to interpret matrices (as clusterings) output by mcl using mcl's -dump ite option.

      Use clm imac only if you have a special reason; the normal usage of mcl is to do multiple runs for varying -I parameters and use	the  clus-
      terings output by mcl itself.  One reason is if you are interested in clusterings with overlap; early MCL iterands generally induce cluster-
      ings possessing overlap.	Another reason is to investigate how the cluster structure associated with the MCL process evolves over time.

  OPTIONS
      -imx fname (input file)
	The input file is presumably an MCL iterand resulting from the mcl option -dump ite.

      -strict num (in 0..1)
	Higher values (up until 1) will thin out the DAG constructed by clm imac. The default value is 0.00001, yielding the full DAG.

      -o fname (file name/stem)
	Write to file named fname.

      -dag fname (output DAG)
	Write the DAG (directed acyclic graph) constructed from the input to file. This DAG is constructed according to the  structure	associated
	with  diagonally positive semi-definite matrices as described in the PhD thesis Graph clustering by flow simulation.  Consult mclfamily(7)
	for references.

      -sort str (size|revsize|lex|none)
	Sort the clusters either by increasing size, decreasing size, lexicographically by the indices they contain, or use the clustering exactly
	as obtained from the interpretation routine.

      -overlap mode (overlap mode)
	With  mode  set  to  cut,  remove  any overlap by allocating the nodes in overlap to the first cluster in which they were found. Mode keep
	leaves overlap unchanged, and mode split results in overlapping parts excised and introduced as clusters in their own right.

  AUTHOR
      Stijn van Dongen.

  SEE ALSO
      mclfamily(7) for an overview of all the documentation and the utilities in the mcl family.

  clm imac 12-068						      8 Mar 2012							 clm imac(1)
All times are GMT -4. The time now is 09:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy