Re: find and delete older file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Agi Subagio" <agi.subagio@xxxxxxxxxxxxxxxxxx>
> 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
> ago.
> 
> 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 should use something like...

$ find ./test -mtime +30 -exec rm -f {} \;

Will.


-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux