LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-20-2009, 05:15 AM   #1
shavha
LQ Newbie
 
Registered: Apr 2009
Posts: 1

Rep: Reputation: 0
Question Hi script to delete old backups which are 3day old


Hi

I want to create a script to delete old backups which are 3day old from my Linux box where do I start? I am new in this field please help
 
Old 05-20-2009, 06:10 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
You can man for find. You can use find options to locate files older than 3 days and then remove it with rm command.

like
Code:
find /path/to/files -type f -ctime +3 | xargs rm -f
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
batch script help for backups investmentbnker75 Programming 5 11-26-2008 11:19 AM
Help with rsync command (or script) multiple file backups luis14 Linux - Software 3 11-08-2007 10:07 PM
script for automatic backups cucolin@ Linux - Software 7 03-29-2007 03:42 PM
Script that automates backups using ftp linuxmandrake Programming 4 11-25-2005 05:12 PM
cron script backups cbeach512 Linux - Newbie 1 01-06-2004 02:00 PM


All times are GMT -5. The time now is 10:25 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration