I have a folder /var/backup where a cronjob saves a backup of a database/filesystem. It contains a latest.gz.zip and lots of older dumps which are names timestamp.gz.zip. The folder ist getting bigger and bigger and I would like to create a bash script that does the following:
- Keep latest.gz.zip
- Keep the youngest 10 files
- Delete all other files
Unfortunately, I'm not a good bash scripter so I have no idea where to start. Thanks for your help.