Answer the question
In order to leave comments, you need to log in
Bash script. How to delete files?
Hello!
There is a Bash script that makes a backup copy of the database. File name template: ${db}-${DATE}
Could you tell me how to add a script so that it deletes old versions of backups?
Answer the question
In order to leave comments, you need to log in
Filename pattern: ${db}-${DATE}
find . -type f -file "DBBACK__*" -mtime +1 -exec echo {} \;
Delete all files older than 30 days in the current directory.
find ./ -type f -mtime +30 -print0 | xargs -0 rm -f
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question