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