Deleting files n days old?

I have backup script that creates backup each morning. It also tries to send it to me via email for backup purposes. As mail sending is not that reliable, I leave backup files on Mikrotik. That worked fine while I used hard disks. Now, when I switched to RouterBoards, available memory is quite small, and gets filled up in quite short time.

When memory is full, Mikrotik fails as it seems to be trying to save current configuration from tiem to time. That means, if disk is full, configuration cannot be saved, and first restart of router makes it unusable.

What i need is script that deletes older backup biles (for isntance 3 days old), so I can keep reasonable number of backups and keep disk space free. I tried to do it myself, but got nowhere.

Any help will be appreciated.

I still did not solve this. :frowning:

try smoething like this:

>/file :put [find where creation-time~"jan/02/1970"]          
*1f01016d;*1f01058d;*1f010694;*1f0106cc;*1f010a79

have router without ntp configured, as result year is 1970 :slight_smile: but this way you should be able to get id’s of files that are created in that day and remove them, replacing :put with remove

I guess this is my english fault. I mant, deleting files n days old and older than that.

This example does not return any records on my MT (I’ve set correct date), I tried on vesrion 3 and 4. I even tried :put [find where creation-time~“(.*)”] but it also does not return any record.