Script to pick out files from a file which are older than 15 days


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to pick out files from a file which are older than 15 days
# 1  
Old 04-02-2008
Script to pick out files from a file which are older than 15 days

Hi ,
I have a file abc.txt which actually contains a directory and file list

-rwxrwxr-x 1 dmadmin mmasapp 334 Dec 03 2001 aafs_006.ksh
-rwxrwxr-x 1 dmadmin mmasapp 1270 Nov 13 2001 mcl_deposit_ftp.ksh
-rwxrwxr-x 1 dmadmin mmasapp 925 Oct 31 2001 run_brc_process1.ksh
-rwxrwxr-x 1 dmadmin mmasapp 1176 Oct 31 2001 run_brc_process2.ksh
-rwxrwxr-x 1 dmadmin mmasapp 976 Sep 27 2001 run_ccs_aggr.ksh
-rwxrwxr-x 1 dmadmin mmasapp 291 Sep 11 2001 update_vol_cntct_prf.ksh
-rwxrwxr-x 1 dmadmin mmasapp 1251 Jul 23 2001 load_pb.ksh
-rwxrwxr-x 1 dmadmin mmasapp 1264 Jul 12 2001 load_pb.ksh_20010612
-rwxrwxr-x 1 dmadmin mmasapp 1250 Jul 02 2001 jc_load_pb.ksh
-rwxrwxr-x 1 dmadmin mmasapp 1250 Jul 02 2001 load_pb.ksh_20010702
-rwxrwxr-x 1 dmadmin mmasapp 525 Jun 12 2001 call_pb.ksh
-rwxrwxr-x 1 dmadmin mmasapp 342 May 25 2001 load_esi_cycle.ksh
-rwxrwxr-x 1 dmadmin mmasapp 254 Oct 11 2000 lch.ksh
-rwxrwxr-x 1 dmadmin mmasapp 207 Oct 09 2000 load_census.ksh
now I need to write a shell script which reads this file abc.txt and picks out all files which are older than 15 days and puts them into another file.

Please help
# 2  
Old 04-02-2008
Go to directory where those files are and run this.

find . -maxdepth 1 -mtime +15 -ls
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Should pick latest file within past 3 days using UNIX script and perform steps in message below.

Hi , Can anyone help me how do perform below requirement in unix. Step1:we will receive multiple files weekly with same name(as below) in a folder(In folder we will have other files also def.dat,ghf.dat) Filenames: 1) abc_20171204_052389.dat 2)abc_20171204_052428.dat DON'T modify... (23 Replies)
Discussion started by: sunnykamal59
23 Replies

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

3. Shell Programming and Scripting

Need Help in ksh Script to list files older than 365 days from specified directories

Requirement is to list the files older than 365 days from multiple directories and delete them and log the list of files which are deleted to a log file. so 1 script should only list files older than 365 days for each directory separately to a folder The other script should read these files... (7 Replies)
Discussion started by: prasadn
7 Replies

4. UNIX for Dummies Questions & Answers

Find all log files under all file systems older than 2 days and zip them

Hi All, Problem Statement:Find all log files under all file systems older than 2 days and zip them. Find all zip files older than 3days and remove them. Also this has to be set under cron. I have a concerns here find . -mtime +2 -iname "*.log" -exec gzip {} Not sure if this will work as... (4 Replies)
Discussion started by: saurabh.mishra
4 Replies

5. Shell Programming and Scripting

Writte a script to copy the files older than 7 days using find and cp

Hi I'm trying to writte a script (crontab) to copy files from one location to another... this is what i have: find . -name "VPN_CALLRECORD_20130422*" | xargs cp "{}" /home/sysadm/patrick_temp/ but that is not working this is the ouput: cp: Target... (5 Replies)
Discussion started by: patricio181
5 Replies

6. Shell Programming and Scripting

Script to delete files older than x days and also taking an input for multiple paths

Hi , I am a newbie!!! I want to develop a script for deleting files older than x days from multiple paths. Now I could reach upto this piece of code which deletes files older than x days from a particular path. How do I enhance it to have an input from a .txt file or a .dat file? For eg:... (12 Replies)
Discussion started by: jhilmil
12 Replies

7. Shell Programming and Scripting

Script to delete files in a folder older than 2 days

hi i need a script to delete the files older than 2 days... if my input is say in a folder versions A_14122012.txt A_15122012.txt A_16122012.txt A_17122012.txt i want my output to be A_16122012.txt A_17122012.txt thanks in advance hemanth saikumar. (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies

8. Shell Programming and Scripting

script to remove files older than 60 days

Hi I need help in the script which looks at a contorl file which has a list of file names like xxxx.12345 and I want to take only xxxxx and search in a specific directory and remove the file if its older than 60 days I have written something like this.. but seems to be wrong... (1 Reply)
Discussion started by: antointoronto
1 Replies

9. Shell Programming and Scripting

Need script to tar files older than 30 days

Hi all. Here's my situation: I have performance reports that run every 30 minutes saved in the format: stats_report_11251000.txt stats_report_11251030.txt stats_report_11251100.txt stats_report_11251130.txt (Obviously run at Nov 25 10 AM, 10:30 AM, 11 AM and so on...) I would... (2 Replies)
Discussion started by: jamie_collins
2 Replies

10. Shell Programming and Scripting

Delete files older than 2 days using shell script in Unix

I'm new to shell script.... can any one help... What is the shell script to delete the files older than 2 days ? (3 Replies)
Discussion started by: satishpabba
3 Replies
Login or Register to Ask a Question