Mailinglist Archive: opensuse (4547 mails)

< Previous Next >
Re: [SLE] find and delete older file
  • From: James Knott <james.knott@xxxxxxxxxx>
  • Date: Fri, 21 May 2004 07:00:39 -0400
  • Message-id: <40ADE157.6040906@xxxxxxxxxx>
Agi Subagio wrote:
I have a script that create a backup file in regular schedule (run everyday
at 2 AM).
But after several weeks, my harddisk is getting full.
I want to delete older backup file that not modified/create after 30 days

I have used command;
$ find ./test -mtime +30 -exec 'rm -f *'
But it seems, the rm command is not work.

How to do that?

You may want to try logrotate, which is designed to manage multiple generations of a file. You can configure it, to archive the previous file, on a daily basis, prior to running the new backup, and to drop the oldest version.

< Previous Next >