The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Backup my files to DAT jefferson UNIX for Dummies Questions & Answers 1 09-30-2007 11:13 PM
Counting Files and send an email Notification if it exceeds a limit amitsayshii UNIX for Dummies Questions & Answers 10 07-07-2006 11:25 AM
backup files for a specific month problems Shell Programming and Scripting 3 04-28-2006 04:53 AM
limit to number of files in a given directory hedrict UNIX for Advanced & Expert Users 2 02-05-2004 04:14 PM
limit of files in the ufs filesystem witt UNIX for Dummies Questions & Answers 2 06-25-2002 11:02 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 09-30-2003
kjaisan kjaisan is offline
Registered User
  
 

Join Date: Sep 2003
Posts: 11
Limit backup files

Hello all,

I am building a shell script. Every morning my shell script will trigger an external system backup script and the backup file (File Name format: "20030929backup.bkp" (i.e)current date + "backup.bkp") will be stored in the backup directory. After successful back, I need to keep only 10 backup files in the backup folder at most. Say on 11th day, day 1 file should be deleted and the 11th day file should be created. What's the best way to do this?

I am using the below command to get the list of backup files from backup directory.
$ find /home/EBI -name "*.bkp" -exec ls {} \;

We need to calculate the calendar days.

I thought of using (-atime +10) but, the thing is this backup script will not run on Sundays. So we miss one day... I guess we may need to count the number of backup files, find the oldest one, delete it and add the current file. What's the simple way to do this?

Thanks.
 

Bookmarks

Tags
mailx, mailx attachment, sendmail

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:07 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0