Files
backupsd/purgerepo.sh
2023-09-29 07:20:34 +02:00

15 lines
253 B
Bash
Executable File

#!/usr/bin/env bash
files_to_remove=$(find . -maxdepth 1 -type f|cut -c3-|xargs ls -t|tail -3)
echo "eldest files ${files_toremove}"
for backupfile in ${files_to_remove}; do
echo "deleting backup ${backupfile}"
rm -f "${backupfile}"
done