Auto Delete Back After X Days (using auto backup script)


I am using the setup script: Ubuntu 16.04 LTS Setup Guide which includes an auto backup of the bot. Now I was wondering if there is a way of auto deleting backups (so there isnt loads of backups just sitting there on the server) after X amount of days (X being the amount of days user wants to keep the backups)


Add to cron to delete all files over 10 days old; change the 10 to what makes sense for you:

1 5 * * * find /home/botuser/backup/phantombot/ -mtime +10 -exec rm -f {} \;