Quote Originally Posted by BowCatShot View Post
What about cd /media/backup folder && ls -t | sed -e '1,4d' | xargs -d '\n' rm
it was not working but i can't remember what was the problem.

finally it worked with:

find /BACKUP_DIR -maxdepth 1 -type f -name "Backup_*.tar.gz" | sort - r | sed -e '1.4d'|xargs -d '\n' rm
it works but..i'm not very confident in that "sort -r". it's a good idea to use recursive sort by name to delete the oldest one?