LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-25-2006, 05:55 AM   #1
noir911
Member
 
Registered: Apr 2004
Posts: 682

Rep: Reputation: Disabled
purging old backup suggestions


I got backups coming each night on my backup server. I want to purge old backup files so they don't fill up the disk space.

My backup files don't have any universal naming convention, only they are all either .gz or tar.gz files. So a file name could be "file-date.tgz". I was wondering how will I go about writing a script that will purge old backups?

I was thinking of using find where it will purge any files older than 20 days old.

Is there any other easy way I could purge old backups or am I left with find only?

Last edited by noir911; 10-25-2006 at 06:07 AM.
 
Old 10-25-2006, 03:24 PM   #2
uselpa
Senior Member
 
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 47
What's wrong with find?
 
Old 10-25-2006, 08:39 PM   #3
noir911
Member
 
Registered: Apr 2004
Posts: 682

Original Poster
Rep: Reputation: Disabled
Nothing wrong with find. Just wondering if there's anything better out there or there's any other better way to do this!
 
Old 10-26-2006, 06:27 AM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
I use find to remove and clean up old backups, usually keep a 45 day retention on backups..

Code:
find /dir/to/find/and/remove/*.gz -type f -mtime +45 -exec rm {} \;
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Suggestions for network backup ogee Linux - Software 2 10-16-2006 02:31 PM
Linux Backup over network suggestions? MKayZ Linux - General 3 07-15-2006 12:59 AM
Backup Software suggestions JurgyMan Linux - Software 3 04-04-2005 03:27 PM
Backup server suggestions? jamespetts Linux - Software 2 10-08-2004 01:36 AM
data backup solution suggestions disorderly Linux - General 5 08-31-2004 07:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration