Advertisement

06.25.2008 at 07:26AM PDT, ID: 23514556
[x]
Attachment Details

linux scripts to manage a directory of files

Asked by Rance_Hall in Linux Administration

Tags: How to manage a directory of export files.

We have a program that generates text files as output as a way to communicate with other systems.


I need to manage this directory in a very careful way and Im having a little trouble figuring out how to do what I need to do.

HERE GOES


The directory in question is a central repository of text files with unique names to ease the file storage archival purposes.


Every 30 minutes a new file named I*******.RP (where ******* is a 7 digit number in an attempt to keep files unique over a reasonably extended period of time (like six months))

There are other files in the same directory with similar names like Q*******.SP, etc.

The format of each name is designed so that we know what type of data is in each file.

We want to manage the data by type, and by age.


I need to be able to manage all files of a certain type with one set of rules, and all files of another type with another set of rules.


for example find all files of type I*******.RP and get rid of any of them older than X days
find all files of type Q*******.SP and get rid of any of them older than Y days


I also need to be able to find the newest file of each type and rename it to  a known file name so that it can be used in scripts that drive the transfer of data to other servers.

eg: find the newest I*******.RP file and rename it to inventory.txt

Im not new to linux scripting, but Im new to some of the find/search tools and how to apply them to this subject.


Thanks all.Start Free Trial
[+][-]06.25.2008 at 12:10PM PDT, ID: 21868894

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Linux Administration
Tags: How to manage a directory of export files.
Sign Up Now!
Solution Provided By: Tintin
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07.02.2008 at 08:15AM PDT, ID: 21917225

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906