Answer the question
In order to leave comments, you need to log in
Script to remove directories older than 3 months?
Colleagues, good afternoon!
There is a directory, let's say "/etc/f1/".
Directories are created in it daily, like "01/01/2020"; "01/02/2020", etc.
I want to delete directories older than 3 months automatically. To do this, I make a script and add it to cron.
Actually the question itself is how to correctly set a regular expression? Something like "rm -rf /etc/f1/{01-31}.{1-12}.2020.
PS Simply using -mtime 90 is not an option, because there will be other files in that directory.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question