using mtime instead of atime with find

This commit is contained in:
Tommaso Piccioli 2023-03-03 17:57:19 +01:00
parent 7b2a0a1b1e
commit 66227f98b8
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ create_backup_dirs() {
cleanup_old_backups() {
# Remove the old backups
find ${HISTDIR} -atime +${N_DAYS_TO_SPARE} -type f -exec rm -f {} \;
find ${HISTDIR} -mtime +${N_DAYS_TO_SPARE} -type f -exec rm -fv {} \;
# TODELETE=$( /bin/ls "${HISTDIR}/" | awk -F '.' '{print $NF}' | sort -ruV | tail -n +${N_DAYS_TO_SPARE} )
# for i in ${TODELETE}
# do