rmoldest in purgerepo umbenannt.

This commit is contained in:
Olli Graf
2023-09-29 07:20:34 +02:00
parent be273b1a11
commit 23979a0859
2 changed files with 15 additions and 0 deletions

14
purgerepo.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/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