Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


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

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


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, 07:10 AM   #2
Senior Member
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
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.

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


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 12:19 PM
Help with rsync command (or script) multiple file backups luis14 Linux - Software 3 11-08-2007 11:07 PM
script for automatic backups cucolin@ Linux - Software 7 03-29-2007 04:42 PM
Script that automates backups using ftp linuxmandrake Programming 4 11-25-2005 06:12 PM
cron script backups cbeach512 Linux - Newbie 1 01-06-2004 03:00 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:37 AM.

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