[How To] Delete Files Older Than X Days In Ubuntu

I use Linode to host my websites. And backing up my files is significant. Linode offers a service called Block Storage that you can use to store your website files backup. The Block Storage can be attached to your Linode server and acts as a directory in your Linode server.

I use a simple bash script to backup my files automatically every day using a cron job. The files keep accumulating in a directory. And that is a problem since I only need the latest three backups utmost.

And I found a beautiful solution using ChatGPT to achieve the same.

Leave a Reply

Your email address will not be published. Required fields are marked *