Normal Topic How to Delete Excess Backups (Read 1045 times)
Acebanner
Full Member
***
Offline



Posts: 123
Location: New York City
Joined: Jan 23rd, 2008
How to Delete Excess Backups
May 4th, 2010 at 5:05pm
Print Post Print Post  
I'm running Sesame 2.5 in a server/client environment. Using sesame.ini I've set the main application to backup on a regular interval (approx. every four hours). These files slowly accrue in a folder off the Sesame root folder with the same name as the application. That's all working fine (and has already saved my bacon once) -- but I was wondering, is there some way to delete some of the excess files? Let's say I wanted to keep only the last week's worth of backup files, how do I delete the extra files?

Right now I just go into the backup folder and delete the oldest files manually, but it would be nice to automate the process.

Any tips or suggestions would be greatly appreciated.
  
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: How to Delete Excess Backups
Reply #1 - May 4th, 2010 at 6:29pm
Print Post Print Post  
I've never used it this way, but RoboCopy has the ability to move files, and the ability to select them based on number of days old. You could run a batch file (or have Sesame do this when you open an app) that moves the old files to another folder, then deletes everything in that other folder.

I haven't tested it, but you might be able make RoboCopy move them directly to the Recycle Bin, making the delete step unnecessary. ???

RoboCopy is a command line utility included with Vista and Windows 7 (and Server 2008). If you don't have it, you can download it from Microsoft as part of the Windows Server 2003 Resource Kit. It's free, you just need to use IE for the download to work. Here is the link:
http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE...
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Acebanner
Full Member
***
Offline



Posts: 123
Location: New York City
Joined: Jan 23rd, 2008
Re: How to Delete Excess Backups
Reply #2 - May 5th, 2010 at 12:20pm
Print Post Print Post  
I'll give that a try Carl, thanks!
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: How to Delete Excess Backups
Reply #3 - May 5th, 2010 at 1:41pm
Print Post Print Post  
You might want to try some .bat file scripting. Look into the "forfiles" command. There are examples available through a google search. Also you might find that using SBasic's file commands and its string scanning and manipulation commands might serve as well.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: How to Delete Excess Backups
Reply #4 - May 5th, 2010 at 2:33pm
Print Post Print Post  
Mark, I'm so glad you posted about "Forfiles"! Smiley Smiley Smiley

I just wrote a batch script last week that uses the "For" command. Forfiles is sooo much easier for the purpose I need. Looks like I'll be rewriting that batch file.  Tongue

I was planning on publishing the script I created in IS. At least now, it will be easier for people to follow.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1350
Location: New Hampshire
Joined: Mar 11th, 2003
Re: How to Delete Excess Backups
Reply #5 - May 5th, 2010 at 3:54pm
Print Post Print Post  
Bummer! Forfiles is not in XP, and it is not listed in the resource kit I linked to earlier. Probably because I think it is already included with server versions of Windows.

It works great in Windows 7. But, for the article, I think I will need to keep my solution of using the "For" command, so everyone can easily make use of it.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged