Shell script/cmd to remove old folders in a directory?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Shell script/cmd to remove old folders in a directory?
Hello,
Hoping someone could help me here, we have a back-up that takes snapshots of one of our DB servers and copies over the files to another server's directory for back-up.
This directory can grow rapidly with many back-ups as they are taken on a 5-minute timer.
I was looking for a shell script/cmd line to remove any folders in a specific directory that is older than 10 days.
I put an echo command in there so you don't accidentally nuke all your backups on the first go. Make sure the output is as you expect, then remove the echo and let rm do its thing.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.