Remove older backups like 1 month

Gabriel9999

New Member
I have some backup files which are created in a Daily manner. After some time they take a lot of space and i want to delete them according to their time stamp like delete 1 month olders. Thanks.
 


Condobloke

Well-Known Member
G'day Gabriel, and Welcome to linux.org

What was used to make these backups?

Where are they stored ?.....same hard drive as the OS?...or an external hard drive ?

Which OS are you running?....which desktop etc
 

Gabriel9999

New Member
G'day Gabriel, and Welcome to linux.org

What was used to make these backups?

Where are they stored ?.....same hard drive as the OS?...or an external hard drive ?

Which OS are you running?....which desktop etc

Hi,
Same hard drive as the OS
Only for files stored in linux
 

JasKinasis

Well-Known Member
Find command is very useful option here. You can search for files older then 1 month and delete them with -delete option.
$ find /tmp -mtime +7 -type f -name '*.tmp' -delete
A very good suggestion, but the example you have posted finds and deletes files that were modified more than 7 days ago.

For the OP to find and delete backup files that were modified over a month ago they would need to use +30 for the -mtime option.
 

Members online


Latest posts

Top