473,378 Members | 1,507 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Script to delete old files based on creation date

nek
Greetings,

I am running DB2 WSE V8.1, FP5 on W2K.

The problem is not directly related to DB2 but as part of job, I need
to manipulate files coming in from all sources.

Under a main folder, every subfolder signifies data coming from a
different source. The source can further subdivide into more folders.

For example:

D:\MainFolder\Ireland\fa\files1
D:\Mainfolder\Ireland\fb\fc\files2
D:\MainFolder\Malaysia\fa\fd\fe\files3
D:\Mainfolder\Malaysia\fb\fg\files4

The subfolder levels vary and there is no fixed pattern.

How can I construct a script so that it will drill down the main
folder and delete all files from all subfolders that are older than 10
days, say, based on the file creation date?

Thank you for any hints and suggestions.
Nov 12 '05 #1
0 4649

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: richardkreidl | last post by:
I have the following module that I delete old files based on how old they are: Sub Main() Dim First_Date As String = Date.Today.AddDays(-7) Dim Archive_Files() As String =...
2
by: Thomas W | last post by:
I'm trying to wrap my head around the docs at python.org related to the gettext-module, but I'm having some problem getting it to work. Is there any really simple, step-by-step on how to use this...
2
by: jonathan184 | last post by:
Hi I am trying to create a shell script that will look for a contracthead file first and if the contract head file does not exist on day1 exit script. Now on day2 if contracthead exists or...
2
by: Viewer T. | last post by:
I am trying to write a script that deletes certain files based on certain criteria. What I am trying to do is to automate the process of deleting certain malware files that disguise themselves...
3
by: Matt | last post by:
I have several folders on a server that contains files that go back 3-4 years. It was mentioned that keeping files that long is no longer needed. So my question is, is there a way to create a windows...
3
by: jaeden99 | last post by:
I was wandering if nyone has a script to move files older than x days old? i've seen several to delete, but I don't want to delete. I would like to create a backup of the files first verify with...
2
by: Thomas Bauer | last post by:
Hello, Call DeleteFiles bgW_DeleteFilesProcess = new DeleteFiles(); bgW_DeleteFilesProcess.RunAsync( folder, 5, "*.txt", new RunWorkerCompletedEventHandler( RunWorkerCompleted_DeleteFiles_TXT )...
3
by: aRTx | last post by:
I have try a couple of time but does not work for me My files everytime are sortet by NAME. I want to Sort my files by Date-desc. Can anyone help me to do it? The Script <? /* ORIGJINALI
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.