Advertisement

07.23.2008 at 07:49AM PDT, ID: 23588693
[x]
Attachment Details

Report on files older then 90 days

Asked by avatech in Bourne-Again Shell (bash), Linux Administration

Tags: Ubuntu, Linux, 6.10 and 7.10, file aging

Two Part Question:

I have an Ubuntu FTP server that I want to generate a test report on files (with full path) that are 90 days or older.  The second part would then be to delete any files older than 90 days with an exception list of a  directories to be ignored.

I have setup a mirror with rsync to test these scripts out of production and have done some Google searches and not sure which way to go.  Some suggest using -ctime or -mtime.  Then there is the debate over using -exec over xargs to perform the deletion.

The FTP site has thousands of files so I'm looking for the most efficient method to first generate the report, then remove files and directories older than 90 days, with some directories to be excluded, where exclusions are read from a text file so that they can be changed as needed for specific projects.

Any suggestions or further reading specific to what I am trying to accomplish would be greatly appreciated.  I'm comfortable with command line but really inexperienced with bash scripting and this is an area I really need to brush up on for automating tasks like these.Start Free Trial
 
 
[+][-]07.23.2008 at 08:03AM PDT, ID: 22070040

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.

 
[+][-]07.23.2008 at 08:21AM PDT, ID: 22070231

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

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

 
[+][-]07.23.2008 at 01:49PM PDT, ID: 22073692

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

Zones: Bourne-Again Shell (bash), Linux Administration
Tags: Ubuntu, Linux, 6.10 and 7.10, file aging
Sign Up Now!
Solution Provided By: Tintin
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628